sceneImg to png file from second sensor

Hi All,

Im using the sample code of MultiView reconstruction, after each frame i want to save the sceneImg as png file.

for sensor 0 i get a good image (png file), but for the sensor 1 i got a black image.
if i try to do the same for colorImage, every thing is ok (both sensor have a good image)

Every help is appreciated

Thanks for your trouble.

The code:

 for (int i = 0; i < m_sensor.size(); ++i)
{
	if (!ok[i])
		continue;

	// Get image size
	int cw = m_colorImg[i]->width();
	int ch = m_colorImg[i]->height();
	int dw = m_depthImg[i]->width();
	int dh = m_depthImg[i]->height();

	if (m_reconstruct && m_rec)
	{
		// Add frame to reconstruction
		bool status;
		bool ret = m_rec->addFrame(i, *m_depthImg[i], *m_colorImg[i], &status, m_sceneImg[i], 0,&m_sensorT[i]);
		if (ret && status)
		{
			LOG_INFO("ProcessFrames - status & ret ok ", "sensor", i);
			string path = "c:/POC/check/frame_" + to_string(i) + "_" + to_string(index) + ".png";
			PngIO::writeImage(path.c_str(), m_sceneImg[i]->data(), m_sceneImg[i]->width(), m_sceneImg[i]->height(), 4, 0); // got black image for sensor 1 (i==1)
           //PngIO::writeImage(path.c_str(), m_colorImg[i]->data(), m_colorImg[i]->width(), m_colorImg[i]->height(), 3, 0); // working good for both sensor

                    }

Found the problem, the m_sensorT matrix are both identity matrix (didn’t calibrate yet . . . . )
I changed one of the matrix and the images is ok.

I have the same problem as you. Is it convenient to tell me your email? So I can reach you.

Please refer to this post. Internally only scene image from sensor 0 gets filled, scene images for other sensors will remain empty

1 Like