none
recognize first skeleton ONLY RRS feed

  • Question

  • Hi!does anybody know how can i make kinect recognize only the first skeleton it "sees"?i want to work only with the first skeleton co-ordinates and when appear second skeleton i don't want to have problems.
    Tuesday, January 31, 2012 4:30 PM

All replies

  • Hi, 
    
    Check if this works
    
    SkeletonFrame allSkeleton = e.SkeletonFrame;
                SkeletonData data = (from s in allSkeleton.Skeletons
                                     where s.TrackingState == SkeletonTrackingState.Tracked
                                     select s).FirstOrDefault();
    

    Thursday, February 2, 2012 2:42 PM
  • ykbharat's code will find the first tracked skeleton in the array, but if the skeleton tracker later sees other people enter the scene, it may automatically switch to tracking them instead.

    What you want to use is the AppChoosesSkeletons property, in conjunction with the ChooseSkeletons method.

    Once you've identified the skeleton s that you're interested in tracking, do this:

    sensor.SkeletonStream.AppChoosesSkeletons = true;
    sensor.SkeletonStream.ChooseSkeletons(s.TrackingId);

    If, on a subsequent frame, you find that the skeleton with that tracking ID is no longer present, that means the person is gone. If you want to automatically find another skeleton to track, set AppChoosesSkeletons back to false, which will return the skeleton tracker to auto-detect mode. When it finds another new skeleton, you can repeat, as above.

    John
    K4W Dev

     

    • Proposed as answer by Joshua Blake Friday, February 3, 2012 1:02 AM
    Thursday, February 2, 2012 8:52 PM
  • i want to be tracked only the first person appears at kinect no matter who is he.if appears a second one i dont want to track the second person.i want to take data only from the first, because i need the co-ordinates from it(first person) and make calculations with them.can i do this with ? or there is another way?
    SkeletonFrame allSkeleton = e.SkeletonFrame;
                SkeletonData data = (from s in allSkeleton.Skeletons
                                     where s.TrackingState == SkeletonTrackingState.Tracked
                                     select s).First(); 
    Saturday, February 4, 2012 5:55 PM