Convert depth pixel to world coordinates RRS feed

  • Question

  • Is there a way to get the world coordinates given an element from the depth map? By world coordinates I mean the same coordinate space used by the skeleton joints.
    Thursday, June 16, 2011 11:01 PM


All replies

  • Hi, have you looked at:

    • C#: SkeletonEngine.DepthImageToSkeleton
    • C++: NuiTransformDepthImageToSkeletonF

    Hope this helps,

    I'm here to help
    Friday, June 17, 2011 1:29 AM
  • Hi Eddy,

    I have tried the function SkeletonEngine.DepthImageToSkeleton. but it seems that it takes input (depthx, depthy, depth Value). How can we get the x and y coordinates (range from 0 to 1) of a pixel?




    Wednesday, June 22, 2011 3:40 PM
  • Where is the documentation for NuiTransformDepthImageToSkeletonF ?



    Thursday, June 23, 2011 5:57 PM
  • Ken,

    I was looking for the documentation myself.  I managed to find it.  If you open the directory where you install the Kinect SDK open the docs folder.  Within that you will see the file "KinectSDK.chm"  Run this and you will see the reference documentation for the entire sdk.  The full path to this file for me was:


    C:\Program Files (x86)\Microsoft Research KinectSDK\docs\KinectSDK.chm


    Obviously this may change depending on your setup.  Hope this helps,


    Sunday, June 26, 2011 6:45 PM
  • Hi


    For such an obvious need why isn't there a simple m_Points[NUI_SKELETON_POSITION_joint].z value?


    As there isn't can anyone explain what code could be added to the skeleton viewer example to give the depth of a specific joint to a simpleton like me?


    Ta muchly


    Monday, June 27, 2011 2:14 PM
  • ah, I should have said in C++.  I have figured out how to see if a joint moves left or right by more than a certain amount and wanted to check for the same movement 360 degrees horizontally.

    e.g. if there was a z value I would check that and the vector (hypotenuse) of x and z combined.

    Monday, June 27, 2011 2:34 PM
  • Chickpea, have you looked at the values in the NUI_SKELETON_DATA.SkeletonPositions array? Each array element is a joint position as a Vector4 value with x, y, and z values. A given joint is always at the same array index, as specified in the NUI_SKELETON_POSITION_INDEX enumeration.

    Monday, June 27, 2011 10:14 PM
  • JC_Gilbert,

    If you have a depth image that is 320x240, then pixel (100,30) would be at (100.0/320,30.0/240), or (0.3125, 0.125) in the coordinates re-scaled to be from 0 to 1.


    I'm here to help
    Wednesday, June 29, 2011 7:29 PM