3

the community has already helped me to guide me in this project.

I am working with the R200 camera, Visual studio 2015, C ++, Windows 10 and OpenCV 3.1.

I currently do the image preprocessing separately in the left and right infrared cameras to identify objects. I need the coordinates (x, y, z) of the object's geometric center, so I have to do a coordinate mapping, but the SDK only allow to do it between depth and RGB:

// Create the PXCProjection instance.  
PXCProjection *projection=device->CreateProjection();  

// color and depth image size.  
PXCImage::ImageInfo dinfo=depth->QueryInfo();  
PXCImage::ImageInfo cinfo=color->QueryInfo();  

// Calculate the UV map.  
PXCPointF32 *uvmap=new PXCPointF32[dinfo.width*dinfo.height];  
projection->QueryUVMap(depth, uvmap);  

// Translate depth points uv[] to color ij[]  
for (int i=0;i<npoints;i++) {  
 ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;  
 ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;  
}  

// Clean up  
delete[] uvmap;  
projection->Release();

Does anyone know how to perform the mapping between left or right IR and depth? Or in its default IR left or right RGB for me to do the mapping in depth?

Thank you very much.

fhfonsecaa
  • 41
  • 4

1 Answers1

1

At the beginning I needed to find out how to map a specific point detected on one of the infrared cameras to the depth image. So, my final solution was to subtract the sector of interest (detected in the IR Left camera, which is the nearest to the color camera) from the RGB image and from the result doing the mapping to depth.

The gap exists, but is not too much.

https://i.stack.imgur.com/hjCjD.png

fhfonsecaa
  • 41
  • 4