none
Confusion on Kinect Nomenclature and People Tracking RRS feed

  • Question

  • 1. Per the Wikipedia, the Kinect can 'visually' track up to six people, but can only track the joints of 2 out of those six. Are all people being tracked called "skeletons"? Or just the two people who are having their joints tracked?

    2. What data is available for the other 4 people that are not having their joints tracked? Distance to Camera? X and Y coordinates? 

    3. If there were six people being tracked, can I specifically select the two people that I want to have joints tracked?

    4. Is there an EASY way of getting the count of the number of people that are tracked/seen?


    Thomas M. Riverside Robotics www.robots-and-androids.com
    Tuesday, August 23, 2011 7:06 AM

Answers

  • Eddy,

    This is the VB code that I came up with and it worked. It seems that I had to ADD the counts of both "tracked" and the "positionOnly" skeletons to get the total # of people in front of the camera. 

    Dim allSkeletons As SkeletonFrame = e.SkeletonFrame
    Dim totalSkeletons As Integer
    
    Dim numberOfSkeletonsT As Integer = (From s In allSkeletons.Skeletons
         Where s.TrackingState = SkeletonTrackingState.Tracked
         Select s).Count() 
    
    Dim numberOfSkeletonsP As Integer = (From s In allSkeletons.Skeletons
         Where s.TrackingState = SkeletonTrackingState.PositionOnly
         Select s).Count() 
    
    totalSkeletons = numberOfSkeletonsP + numberOfSkeletonsT
    
    

    Again, this worked. 
    Thomas

     


    Thomas M. Robots-and-Androids

    Monday, August 29, 2011 11:10 PM
  • Version 1.0 of the Kinect for Windows SDK added the ability to choose which skeletons are tracked...out of the 6 candidates.

    kinectSensor.SkeletonStream has the following  members which enable you to determine which candidates are tracked

    (copy and pasted from the Kinect SDK Documentation installed with the SDK)

    SkeletonStream.AppChoosesSkeletons: Gets or sets a Boolean value that determines whether the application chooses
    SkeletonStream.ChooseSkeletons(): Allows the system to choose which skeletons to track.
    SkeletonStream.ChooseSkeletons(int): Chooses one skeleton to track.
    SkeletonStream.ChooseSkeletons(int, int): Chooses two skeletons to track.

    The KinectExplorer sample has code that uses these APIs in several ways.

    Thanks, Rob Relyea | Kinect for Windows team | http://twitter.com/rrelyea

    Friday, March 2, 2012 5:20 PM

All replies

  • Hello there,

    Here is part of the programing guide that I think answers to most of your questions :

    “The skeletal tracking engine provides full skeletal tracking for one or two players in the sensor's field of view. When a player is actively tracked, calls to get the next skeleton frame return complete skeleton data for the player. Passive tracking is provided automatically for up to four additional players in the sensor's field of view. When a player is being tracked passively, the skeleton frame contains only limited information about that player's position. By default, the first two skeletons that the skeletal tracking system finds are actively tracked.

    The runtime returns skeleton data in a skeleton frame, which contains an array of skeleton data structures, one for each skeleton that the skeletal tracking system recognized. Not every skeleton frame contains skeleton data. When skeleton tracking is enabled, the runtime signals a skeleton event every time it processes a depth frame, as described in the previous section.

    For all returned skeletons, the following data is provided:

    ·         The current tracking state of the associated skeleton:

    o    For skeletons that are passively tracked, this value indicates position-only tracking.

             o    For an actively tracked skeleton, the value indicates skeleton-tracked.

    ·         A unique tracking ID that remains assigned to a single player as that player moves around the screen.

    ·         The tracking ID is guaranteed to remain consistently applied to the same player for as long as he or she remains in the field of view. A given tracking ID is guaranteed to remain at the same index in the skeleton data array for as long as the tracking ID is in use. If the tracking ID of the skeleton at a particular index in the array changes, one of two things has happened: Either the tracked player left the field of view and tracking started on another player in the field of view, or the tracked player left the field of view, then returned, and is now being tracked again.

    ·         A position (of type Vector4) that indicates the center of mass for that player. This value is the only available positional value for passive players.

    ·         For the actively tracked players, returned data also includes the current full skeletal data.

    ·         For the passively tracked players, returned data includes only basic positional and identification data, and no skeletal data. "

     

    Finally to get the number of skeletons here is a sample code:

    void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)

            {

                SkeletonFrame skeletonFrame = e.SkeletonFrame;

               int numberOfSkeletons= skeletonFrame.Skeletons.Length;

    }

     

    Nick


    Tuesday, August 23, 2011 8:18 PM
  • Thanks Nick!

    I'll give it a try later  tonight. 


    Thomas M. Riverside Robotics www.robots-and-androids.com
    Tuesday, August 23, 2011 8:30 PM
  • Actually, for the count of tracked skeletons, skeletonFrame.Skeletons.Length will always return 6, since that is a fixed-length structure. You should do something like:

    int numberOfSkeletons = (from s in allSkeletons.Skeletons
                             where s.TrackingState == SkeletonTrackingState.Tracked
                             select s).Count()


    Eddy


    I'm here to help
    Wednesday, August 24, 2011 8:04 PM
  • Thank you Eddy for looking into this. I am truly enjoying learning about and programming the Kinect. It is an amazing device!

     

    Yes, I tried Nick's solution and only got "six" as you had predicted.

    I'll try your solution later today.

     

    And, can I directly select one of the passively tracked skeletons and start tracking it actively? If so, can you please again provide sample code?


    Thomas M. Robots-and-Androids
    Thursday, August 25, 2011 7:56 AM
  • Eddy,

    This is the VB code that I came up with and it worked. It seems that I had to ADD the counts of both "tracked" and the "positionOnly" skeletons to get the total # of people in front of the camera. 

    Dim allSkeletons As SkeletonFrame = e.SkeletonFrame
    Dim totalSkeletons As Integer
    
    Dim numberOfSkeletonsT As Integer = (From s In allSkeletons.Skeletons
         Where s.TrackingState = SkeletonTrackingState.Tracked
         Select s).Count() 
    
    Dim numberOfSkeletonsP As Integer = (From s In allSkeletons.Skeletons
         Where s.TrackingState = SkeletonTrackingState.PositionOnly
         Select s).Count() 
    
    totalSkeletons = numberOfSkeletonsP + numberOfSkeletonsT
    
    

    Again, this worked. 
    Thomas

     


    Thomas M. Robots-and-Androids

    Monday, August 29, 2011 11:10 PM
  • Glad you could figure this out, Thomas. BTW, regarding "can I directly select one of the passively tracked skeletons and start tracking it actively? If so, can you please again provide sample code?", the answer is no. The skeletal tracking algorithms in Kinect SDK Beta will automatically pick which skeletons are actively vs passively tracked, and you can't choose which ones go where. Sorry about that.

    Eddy


    I'm here to help
    Friday, September 2, 2011 3:10 AM
  •         A position (of type Vector4) that indicates the center of mass for that player. This value is the only available positional value for passive players.

    what does it mean positional value?

    how to obtain it?


    Tuesday, November 8, 2011 4:32 PM
  • question can anyone update this to v1 sdk code?

    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda

    Tuesday, February 28, 2012 2:33 PM
  • Version 1.0 of the Kinect for Windows SDK added the ability to choose which skeletons are tracked...out of the 6 candidates.

    kinectSensor.SkeletonStream has the following  members which enable you to determine which candidates are tracked

    (copy and pasted from the Kinect SDK Documentation installed with the SDK)

    SkeletonStream.AppChoosesSkeletons: Gets or sets a Boolean value that determines whether the application chooses
    SkeletonStream.ChooseSkeletons(): Allows the system to choose which skeletons to track.
    SkeletonStream.ChooseSkeletons(int): Chooses one skeleton to track.
    SkeletonStream.ChooseSkeletons(int, int): Chooses two skeletons to track.

    The KinectExplorer sample has code that uses these APIs in several ways.

    Thanks, Rob Relyea | Kinect for Windows team | http://twitter.com/rrelyea

    Friday, March 2, 2012 5:20 PM