none
How to get real world coordinates use Kinect for Windows SDK 1.0 in C++? RRS feed

  • Question

  • Hello everyone. I am freshman. I want to use Kinect for Windows SDK 1.0 obtain the real world coordinates,eg. left hand position (x,y,depth). who can help me? Thank you!

    Thursday, March 29, 2012 2:48 PM

All replies

  • Please refer to this forum thread (in particular, my most recent post, at the bottom): http://social.msdn.microsoft.com/Forums/en-US/kinectsdknuiapi/thread/631aff06-cb4c-42ff-84ee-d895c94c5da4

    The example in the thread tracks the knee instead of the hand, but the principles are all the same.

    John
    K4W Dev

    Thursday, March 29, 2012 8:22 PM
  • Thank you John! I have got it when I read the thread! Now , I have another question that is how to track one player's hand, default, Kinect can actively track two player,but I just want it track one player. how to do this?
    Friday, March 30, 2012 7:13 AM
  • Once you have found a tracked skeleton, you can instruct the runtime to continue tracking only that skeleton, using the SkeletonStream.ChooseSkeletons method. The code to select the skeleton becomes a little more involved:

    Skeleton skeleton = null; if (this.trackedID != 0) { // Find skeleton we were previously tracking skeleton = this.skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked && s.TrackingId == this.trackedID).FirstOrDefault(); if (skeleton == null)

    {
    // Skeleton is gone; go back to default tracking
    this.sensor.ChooseSkeletons();
    this.trackedID = 0;
    }
    } if (skeleton == null) { // Find first tracked skeleton, if any skeleton = this.skeletons.Where(s => s.TrackingState == SkeletonTrackingState.Tracked).FirstOrDefault(); this.trackedID = skeleton.TrackingId;
    // Tell the skeleton stream to keep tracking this one
    this.sensor.SkeletonStream.ChooseSkeletons(this.trackedID); }

    You will also need new fields in your Tracker class:

        private KinectSensor sensor;
        private int trackedId;

    ...and also initialize this.sensor in the Tracker constructor.

    John
    K4W Dev

    Friday, March 30, 2012 8:54 PM