2017-03-09 65 views
3

社区已经帮助我在此项目中指导我。从左或右红外图像到深度的坐标映射 - R200 Intelrealsense

我正在使用R200相机,Visual studio 2015,C++,Windows 10和OpenCV 3.1。

我目前在左右红外摄像机中分别进行图像预处理以识别物体。我需要的对象的几何中心的坐标(X,Y,Z),所以我必须做一个坐标映射,但SDK只允许深度和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(); 

有谁知道执行左或右IR和深度之间的映射?或者在默认的IR左或右RGB中进行深度映射?

非常感谢。

回答

1

在开始时,我需要找出如何将在其中一个红外摄像机上检测到的特定点映射到深度图像。因此,我的最终解决方案是从RGB图像中减去感兴趣的部分(在距离彩色相机最近的红外左侧相机中检测到的部分),并将结果映射到深度。

差距存在,但不是太多。

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