how to detect skeleton only within a certain depth RRS feed

  • Question

  • Hi,

    I am trying to figure out how to detect skeleton only within the certain distance away from Kinect. My understanding of the SDK is, auto skeleton detection is part of the origin code of the SDK which is not accessible to us, so we cannot tell the kinect to see skeleton only within a certain depth. Am I right? (Although I really need this feature) Thank you!

    Lining YAO
    Friday, September 30, 2011 12:48 AM

All replies

  • Correct, the SDK will automatically choose which skeletons to track, if there are multiple visible in supported depth range. If you need to detect skeletons only within a range, you can examine skeletons that are part of SkeletonFrame.Skeletons array which have TrackingState == SkeletonTrackingState.Tracked. From the tracked ones you can write code to ignore SkeletonData objects whose average position (SkeletonData.Position) is outside of your range. E.g., modifying code from nui_SkeletonFrameReady in SkeletalViewer C# sample:

    foreach (SkeletonData data in skeletonFrame.Skeletons)
        if (SkeletonTrackingState.Tracked == data.TrackingState && data.Position.Z >= ZMin && data.Position.Z <= ZMax)
            // Your code here
    } // for each skeleton


    I'm here to help
    Friday, September 30, 2011 1:01 AM
  • Thank you Eddy. But your suggested solution aroused another problem to me. I suppose my project will happen in a very cloud environment, there are lots of people going around. If there are more than 2 people far away but have been detected by Kinect, then the Kinect won't have extra ability to detect an active skeleton even within my depth range...

    Please correct me if I am wrong.

    Lining YAO
    Friday, September 30, 2011 1:30 AM
  • Correct, if the Kinect does happen to choose people farther away then you won't be able to correct issue. However, algorithms are optimized to pick most prominent people in scene, which tend to be the ones closest to camera, so the problem you describe should be rare.

    That being said, algorithms aren't perfect and we're constantly trying to improve them.


    I'm here to help
    Friday, September 30, 2011 2:08 AM