How to track people more than one or not change tracked people

Aug 6, 2014 at 10:54 AM
I have to create project about exercise shoulder. The people who use this project The player must have another one for help them [stand nearby player] I want kinect to separate the player from other people what code I should write.
Aug 6, 2014 at 6:36 PM
I understand that in your project, more than one person will be visible to the Kinect, but you want the application to respond to just one person.

In the Kinect SDK, you are given an array of skeletons. This array always has 6 skeletons, regardless of the number of people visible to the Kinect. You can tell whether a person is present by checking the status of each skeleton in the array to see if it is tracked. The first person visible might show as tracked in any of the six spots in the array (the index is random -- the zeroth index doesn't mean the first person). Once a person is tracked, their skeleton data will stay in the same index in the array.

For example, Alice walks in front of the Kinect and her skeleton shows up as tracked in skeletons[3]. Then Bob walks in front of the Kinect and now there are tracked skeletons in skeletons[0] and skeletons[3]. Alice's skeleton data is still skeletons[3] and Bob's skeleton data is skeletons[0]. Bob walks away and now skeletons[0] becomes NotTracked and Alice's skeleton data is still tracked skeletons[3]. (Note - the names are simply for explaining the example. The Kinect SDK does not do person identification and does not know which skeleton is which identity.)

For your project, you would have to design a way to determine whether Alice or Bob (for example) is the patient, and then just respond to that person's skeleton by only using the index. For example, if the patient is always visible first, then maybe Alice would be the patient, and then once the exercise activity starts, only respond to the skeleton in skeletons[3] (or whichever index became tracked first.)

As for code, you can look in Kinect PowerPoint Control's source code in MainWindow.xaml.cs to see an example of getting the skeleton data:
    Skeleton[] skeletons;
            using (var skeletonFrame = e.OpenSkeletonFrame())
                if (skeletonFrame == null)

                if (skeletons == null ||
                    skeletons.Length != skeletonFrame.SkeletonArrayLength)
                    skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength];

//now check skeletons for TrackingState == SkeletonTrackingState.Tracked
//and do something interesting with skeletons
//Determine which index into the array is the patient and respond to that index each time, until the exercise ends or tracking is lost
Hope that helps!
Sep 9, 2014 at 7:05 PM
Skeleton[] skeletons; doesn't exist on V2!