none
SkeletonToDepthImage out depth RRS feed

  • Question

  • Hi,

    using the function nui.SkeletonEngine.SkeletonToDepthImage(joint.Position, out depthX, out depthY,out outdepth) the outdepth value is much higher respect to the value of the depth image in depthX, depthY position. The value of the depth image rappresent the distance in mm , what is the meaning of the OutDepth value???

                                                            Thank Marco

    Thursday, July 7, 2011 10:34 AM

Answers

All replies

  • The function has outputs, named depthX and depthY. When the function returns successfully, these represent the location of the pixel in the depth image that corresponds to the position of the joint that was passed in. These values are in the range from 0.0 to 1.0. You must scale them by the width and height of the depth image in order to get the actual (x,y) coordinates of a pixel in the depth window. You can see this being done in the SkeletalViewer sample, in the getDisplayPosition() function.

    Note that if you just want the depth value of that pixel, you can use the overload of SkeletonToDepthImage that has a fourth parameter named depthValue.

    Thursday, July 7, 2011 6:12 PM
  • Thanks, I've just used this function. My question is different: why the depthValue coming from SkeletonToDepthImage has a value much higher if compared to the value of the depth image in the correct Joint point???

                                          Thanks Marco                                                                       


    Friday, July 8, 2011 8:34 AM
  • Which depth image are you using? If you're using the depth image with player segmentation, you need to shift the value right by three, to remove the player segmentation bits.

    Friday, July 8, 2011 6:06 PM
  • Marco,

    Robert is correct. SkeletonToDepthImage outputs "outdepth" in the same format as depth+player index stream, not in the same format as plain depth stream alone (see issue 8 in FAQ: http://social.msdn.microsoft.com/Forums/en-US/kinectsdknuiapi/thread/4da8c75e-9aad-4dc3-bd83-d77ab4cd2f82). In other words, it doesn't output values in millimeters directly, but the least significant 3 bits will correspond to a player index and the next 12 bits will be the depth value. So, as Robert said, you should right shift by 3 the value you get from SkeletonToDepthImage in order to get millimeters from camera.

    Eddy


    I'm here to help
    Friday, July 8, 2011 10:45 PM