Guest User

Untitled

a guest
Jul 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. //obtain depth image
  2. DepthMetaData depthMD;
  3. g_DepthGenerator.GetMetaData(depthMD);
  4. const XnDepthPixel* g_Depth = depthMD.Data();
  5. cv::Mat DepthBuf(480,640,CV_16UC1,(unsigned char*)g_Depth);
  6. //To display the depth image you probably would want to normalize it to 0-255 range first
  7.  
  8.  
  9. //obtain rgb image
  10. ImageMetaData ImageMD;
  11. g_ImageGenerator.GetMetaData(ImageMD);
  12. const XnUInt8* g_Img =ImageMD.Data();
  13. cv::Mat ImgBuf(480,640,CV_8UC3,(unsigned short*)g_Img);
  14. cv::Mat ImgBuf2;
  15. cv::cvtColor(ImgBuf,ImgBuf2,CV_RGB2BGR);
Add Comment
Please, Sign In to add comment