MapDepthFrameToSkeletonFrame RRS feed

  • Question

  • I am working with Kinect and I want to align all 2, depth, RGB and skeleton frame so that  i can get the correct x,y,z values and obtain the right region around the specific joint type. For example joint handleft.

    I have mapped depthframe to colorframe but when I try to get the position it is not inline. I came across this function MapDepthFrameToSkeletonFrame.

    Can someone help me write this function down. I mean i am confused about the skeletonPoint[]. This array receives the data but what do I do next with it.

    Monday, January 14, 2013 10:01 AM

All replies

  • Each element in skeletonPoints represents a three-dimensional coordinate (in meters, measured from the position of the Kinect sensor) that corresponds to the same element in the depth frame.

    If you know the x, y coordinates of a particular pixel in the depth frame, you can obtain its position as follows:

    SkeletonPoint sp = skeletonPoints[y * width + x];

    (where width is the width of your depth frame; for example, if you're using Resolution640x480Fps30, use a width of 640)

    Note that some points may be unknown, if the sensor was unable to determine the depth for specific pixels. You can call kinectSensor.IsKnownPoint(sp) to check whether the point is valid.

    John | Kinect for Windows development team

    Thursday, January 17, 2013 2:10 AM