none
how to align the skeleton to RGB image(in c++)?? RRS feed

  • Question

  • hello,I have align the depth image to the RGB image using the function,NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution. But when I draw skeleton on the RGB image and depth image, the skeleton joints are not aligned to de depth image or RGB image. In c#,we can use a function called Kinect.MapSkeletonPointToColor() .So if in c++,how should I align the skeleton to the image?

    Wednesday, August 15, 2012 12:01 PM

All replies

  • In C++, it is a two-step process. First, call NuiTransformSkeletonToDepthImage:

    LONG depthX;
    LONG depthY;
    USHORT depthValue;
    NuiTransformSkeletonToDepthImage(
        skeletonPoint,
        &depthX,
        &depthY,
        &depthValue,
        depthResolution);
    

    Then, call NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution:

    LONG colorX;
    LONG colorY;
    NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution(
        colorResolution,
        depthResolution,
        nullptr,
        depthX,
        depthY,
        depthValue,
        &colorX,
        &colorY);
    

    At the end of this, colorX and colorY should have the color image coordinates that correspond to the original skeletonPoint.


    John | K4W Dev

    Friday, August 17, 2012 6:19 PM
  • I want to show point clouds(X,Y,Z) with color(R,G,B) in OpenGL,the data gotten through kinect in SDK 1.6.But I don't know how to change depth to XYZ ,and how to align color information RGB with depth information XYZ.This question confused me few days,hope you will help me.Thanks a lot.I am looking forward to you reply.Thanks again!
    Tuesday, November 27, 2012 2:20 AM
  • I want to show point clouds(X,Y,Z) with color(R,G,B) in OpenGL,the data gotten through kinect in SDK 1.6.But I don't know how to change depth to XYZ ,and how to align color information RGB with depth information XYZ.This question confused me few days,hope you will help me.Thanks a lot.I am looking forward to you reply.Thanks again!
    Tuesday, November 27, 2012 2:28 AM