none
How to map the X_Y coordinates from Skeleton.Joints[i] to Image Frame? RRS feed

Answers

  • Have you looked at SkeletonEngine.SkeletonToDepthImage method? That method will output X and Y values as floating point values normalized to a [0.0,1.0] interval, which is coordinates meant to be scaled into an image frame.

    Eddy


    I'm here to help
    Thursday, September 8, 2011 6:58 PM
  • After you map it to depth image space, you can use Runtime.NuiCamera.GetColorPixelCoordinatesFromDepthPixel to get coordinate into colored image space.

    Eddy


    I'm here to help
    • Marked as answer by Juwean Friday, September 9, 2011 6:33 PM
    Friday, September 9, 2011 6:32 PM
  • Yes, actually, the depth coordinates input into this API need to be relative to a 320x240 image. The colorX and colorY coordinates output will be relative to a 640x480 image, as specified in first parameter. So, your code should be:

    nui.NuiCamera.GetColorPixelCoordinatesFromDepthPixel(ImageResolution.Resolution640x480, vieware, (int)(depthX * 320), (int)(depthY * 240), depthValue, out colorX, out colorY);

    Sorry for the confusion.
    Eddy


    I'm here to help
    • Marked as answer by Juwean Sunday, September 11, 2011 3:32 PM
    Saturday, September 10, 2011 1:33 AM

All replies

  • Have you looked at SkeletonEngine.SkeletonToDepthImage method? That method will output X and Y values as floating point values normalized to a [0.0,1.0] interval, which is coordinates meant to be scaled into an image frame.

    Eddy


    I'm here to help
    Thursday, September 8, 2011 6:58 PM
  • Thank you Eddy,

     

    Is there some function can map skeleton onto colored image?

     

    Thank you


    Chenyang
    Thursday, September 8, 2011 11:59 PM
  • After you map it to depth image space, you can use Runtime.NuiCamera.GetColorPixelCoordinatesFromDepthPixel to get coordinate into colored image space.

    Eddy


    I'm here to help
    • Marked as answer by Juwean Friday, September 9, 2011 6:33 PM
    Friday, September 9, 2011 6:32 PM
  • Thank you Eddy:) You really helped.
    Chenyang
    Friday, September 9, 2011 6:33 PM
  • Hey Eddy,

     

    I find something weird, I use this to get the image coordination:

    nui.NuiCamera.GetColorPixelCoordinatesFromDepthPixel(ImageResolution.Resolution640x480, vieware, (int)(depthX * 640), (int)(depthY * 480), depthValue, out colorX, out colorY);

    and the results are quite large. Did I use it wrong?

     

    Chenyang


    Chenyang
    Friday, September 9, 2011 9:05 PM
  • Yes, actually, the depth coordinates input into this API need to be relative to a 320x240 image. The colorX and colorY coordinates output will be relative to a 640x480 image, as specified in first parameter. So, your code should be:

    nui.NuiCamera.GetColorPixelCoordinatesFromDepthPixel(ImageResolution.Resolution640x480, vieware, (int)(depthX * 320), (int)(depthY * 240), depthValue, out colorX, out colorY);

    Sorry for the confusion.
    Eddy


    I'm here to help
    • Marked as answer by Juwean Sunday, September 11, 2011 3:32 PM
    Saturday, September 10, 2011 1:33 AM
  • Thank you very very much! Eddy!

     

    Chenyang


    Chenyang
    Sunday, September 11, 2011 3:32 PM