Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //obtain depth image
- DepthMetaData depthMD;
- g_DepthGenerator.GetMetaData(depthMD);
- const XnDepthPixel* g_Depth = depthMD.Data();
- cv::Mat DepthBuf(480,640,CV_16UC1,(unsigned char*)g_Depth);
- //To display the depth image you probably would want to normalize it to 0-255 range first
- //obtain rgb image
- ImageMetaData ImageMD;
- g_ImageGenerator.GetMetaData(ImageMD);
- const XnUInt8* g_Img =ImageMD.Data();
- cv::Mat ImgBuf(480,640,CV_8UC3,(unsigned short*)g_Img);
- cv::Mat ImgBuf2;
- cv::cvtColor(ImgBuf,ImgBuf2,CV_RGB2BGR);
Add Comment
Please, Sign In to add comment