如何使用NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution将RGB图像与c ++中的深度图像对齐 [英] How to use NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution to align the RGB image to the depth image in c++

查看:154
本文介绍了如何使用NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution将RGB图像与c ++中的深度图像对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想将我的rgb图像与我的深度图像对齐,我正在尝试使用NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution。我试图这样做,但它不起作用。深度图像的格式为uint8_t *,函数
需要USHORT *。所以我只需转换它:

 (USHORT *)DepthData;  


我需要帮助才能使用Kinect SDK v1.8中的内容将rgb图像坐标与深度图像坐标对齐,所以他们拍摄相同的东西,但我仍然希望它们是在不同的图片。这里有一些我尝试使用的代码没有
成功:

 

uint8_t * Kinect :: calibrateRGBfromDepth(BYTE * RGBData,USHORT * DepthData){

LONG * RGBCoords =(LONG *)malloc(sizeof(LONG)* 640 * 480 * 2);

sensor-> NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution(
NUI_IMAGE_RESOLUTION_640x480,
NUI_IMAGE_RESOLUTION_640x480,
640 * 480,
DepthData,
640 * 480 * 2,
RGBCoords);

uint8_t * alignedRGBImage =(uint8_t *)malloc(640 * 480 * 4);

//缺少一些代码,但RGBCoords没有给出正确的值,所以

//是NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution内部错误。


return alignedRGBImage;
}





解决方案

使用坐标映射器:


http://social.msdn.microsoft.com/Forums/en-US/35b1f7da-86bc-4d02-ac79-2334cfa3c961 /深度和彩色帧对准?论坛= kinectsdknuiapi


Hello, I want to align my rgb image to my depth image and i am trying to use NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution. I have tried to do like this, but it doesn't work. The depth image has the format uint8_t* and the function wants a USHORT*. So i just convert it with:

(USHORT*) DepthData;

I need help to use something in the Kinect SDK v1.8 to align the rgb images coordinates to the depth images coordinates, so they are filming the same stuff, but I still want them to be in different pictures. Here is a bit the code I was trying to use without success:

uint8_t* Kinect::calibrateRGBfromDepth(BYTE* RGBData, USHORT* DepthData){ LONG* RGBCoords = (LONG*)malloc(sizeof(LONG)*640*480* 2); sensor->NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution( NUI_IMAGE_RESOLUTION_640x480, NUI_IMAGE_RESOLUTION_640x480, 640 * 480, DepthData, 640 * 480 * 2, RGBCoords); uint8_t* alignedRGBImage = (uint8_t*)malloc(640 * 480 * 4); //Missing some code, but the RGBCoords doesn't give the right values, so something

//is wrong inside NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution.

return alignedRGBImage; }



解决方案

use the coordinate mapper:

http://social.msdn.microsoft.com/Forums/en-US/35b1f7da-86bc-4d02-ac79-2334cfa3c961/depth-and-color-frames-alignment?forum=kinectsdknuiapi


这篇关于如何使用NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution将RGB图像与c ++中的深度图像对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆