none
Skeletal Space Z-Axis Problem. RRS feed

  • Question

  • So are reading a lot on this forums and documenation, I have gathered that the units in the Vector returned by the "SkeletonEngine.DepthImageToSkeleton" method as in meters.
    My question is, why do I get a reading of ~0.10 for Z when I hold a placard up directly in front of the kinect at about a meter away.   Shouldn't the Z value be closer to 1, is all the vector units are in meters?

    Any ideas?

    Stan


    [Yes I used a yard/meter stick to check the distance.]
    Tuesday, July 5, 2011 9:20 PM

Answers

  • Try casting those things to integers before you shift them rather than after.

    • Proposed as answer by johnels Wednesday, July 6, 2011 8:38 PM
    • Marked as answer by ForeverTangent Wednesday, July 6, 2011 9:34 PM
    Wednesday, July 6, 2011 2:48 AM

All replies

  • What depth value are you passing to SkeletonEngine.DepthImageToSkeleton in this situation?
    Tuesday, July 5, 2011 9:38 PM
  • I am using the sample code from the depth quickstart pretty much verbatim...  with the DepthAndPlayerIndex runtime option.

     

    var distance = GetDistanceWithPlayerIndex(depthData[depthIndex], depthData[depthIndex + 1]); 
    
    Microsoft.Research.Kinect.Nui.Vector skeletonSpace = skeletonEngine.DepthImageToSkeleton((160.0 / 320.0f), (120.0 / 240.0f), (short)distance);
    
    private int GetDistanceWithPlayerIndex(byte firstFrame, byte secondFrame)
    {
    //offset by 3 in first byte to get value after player index 
    int distance = (int)(firstFrame >> 3 | secondFrame << 5);
    return distance;
    }
    

    If I print a Debug of the distance value is it pretty much correct in the mm format [about 1000].

    Tuesday, July 5, 2011 10:03 PM
  • Try casting those things to integers before you shift them rather than after.

    • Proposed as answer by johnels Wednesday, July 6, 2011 8:38 PM
    • Marked as answer by ForeverTangent Wednesday, July 6, 2011 9:34 PM
    Wednesday, July 6, 2011 2:48 AM
  • Just to make sure, you are referring to the "byte" arguments in the GetDistanceWithPlayerIndex, correct?

     

    But just tried that.  and no difference. 


    Also to be more specific is about .125 for the Z Value for a Distance of 1000 if I am holding my measurement card right in front of the Kinect about a meter away.

    Seems weird because .125 seems it could be an 1/8 of a full meter,  or 1/8 of depth of 8 meters [~24+ feet], but I have no idea, where that would be happening, espeically since the code is pretty much they showed up what to do in the quick start.

     

     

    Wednesday, July 6, 2011 3:09 AM
  • Ah  I got it...  Yeah that was it,  shifting the depth value before sending it to DepthImageToSkeleton.

     

    Cool Thanks!!!

     

     

    Wednesday, July 6, 2011 3:59 AM