none
Mask for depth image in Fusion reconstruction RRS feed

  • Question

  • How can I apply a mask to the depth images so that only a portion of the images is used in the reconstruction? I would like to reduce the errors introduced by the reduced quality of the calibration on the edges of the image. To do so, I want the reconstruction to use only the 320x240 pixels in the center of the depth images instead of using the full 640x480 pixels.

    My guess is that it would be in the CopyExtendedDepth method where the only the desired bits would be copied. However, the exact way to do it escapes me. Any info would help.

    Saturday, September 28, 2013 5:08 PM

Answers

  • That is certainly one way to do it. Considering the pipeline of Fusion, because it is a continuous scan any "noise" should get filtered out over time and the quality of the scan will improve.

    Carmine Sirignano - MSFT

    • Marked as answer by wxy123 Monday, September 30, 2013 4:45 PM
    Monday, September 30, 2013 4:40 PM

All replies

  • I think that I found a method to disable some areas of the depth sensor. I simply set the depth value to 0 at the points in the array that I don't want the reconstruction to use. The Depth_Mask is simply an array with values set to 1 where I don't want the values of the depth array to be used. I set the values of the depth to 0 using extendedDepthLockedRect.pBits before it is copied into m_pDepthImagePixelBuffer in the CopyExtendedDepth method.

    It seems to work but I would appreciate it if someone could confirm that what I'm doing is correct and that I do not corrupt the reconstruction in some way.

    NUI_DEPTH_IMAGE_PIXEL * pBuffer = reinterpret_cast< NUI_DEPTH_IMAGE_PIXEL *>(extendedDepthLockedRect.pBits);
    
    for(j=0; j < DEPTH_DIMY; j++) {
      for(i=0; i < DEPTH_DIMX; i++) {
       k = (j*DEPTH_DIMX+i);  // index in the 640x480 1-D array
    
       if(Depth_Mask[k] != 0)
    	{
    	pBuffer[k].depth =  0 ; // 0 disables the use of this depth point in reconstruction
    	}
           }
        }

    Sunday, September 29, 2013 8:15 PM
  • That is certainly one way to do it. Considering the pipeline of Fusion, because it is a continuous scan any "noise" should get filtered out over time and the quality of the scan will improve.

    Carmine Sirignano - MSFT

    • Marked as answer by wxy123 Monday, September 30, 2013 4:45 PM
    Monday, September 30, 2013 4:40 PM