问题描述
您好,我想将我的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;
}
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; }
这篇关于如何使用NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution将RGB图像与c ++中的深度图像对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!