none
Tracking only four skeleton RRS feed

  • Question

  • In my program I would track only the first four skeleton (0-3 TrackingId), but I don't know how to reduce BodyCount from 6 to 4. Is it possible?

    Thanks in advance!

     
    • Edited by ChiaraS Monday, March 14, 2016 2:30 PM
    Monday, March 14, 2016 2:02 PM

All replies

  • Simply select the four bodies that you would like to track (for instance the first 4 detected) from the bodies in a BodyFrame and store their TrackingId's. Each new BodyFrame you will first look if these TrackingId's are still available and use those bodies. If not you may want to select new bodies.

    kind regards,

    Roland Smeenk

    Monday, March 14, 2016 3:03 PM
  • First of all, thanks for your answer. But in my case I need to have only four skeleton with 

    Body[] bodies = new Body[frame.BodyCount]

    with frame.BodyCount = 4.

    I need it to assign a predefined color Brush[] to every skeleton and manage them separately. I don't want track the two last skeletons.

    I hope I explained correctly. Thanks!

    Monday, March 14, 2016 3:20 PM
  • You cannot reduce the number of bodies Kinect is tracking and you cannot select the bodies Kinect is tracking if there are more than six of them in the Kinect field of view. You can only decide what to do with them and, as Roland Smeenk said, you can check if a given body is still there with the TrackingId's.
    Monday, March 14, 2016 3:25 PM
  • Thanks for the reply, I solved my problem by creating an Array of four elements containing the first four skeletons's indexes tracked by Kinect. The last two skeletons are anyway tracked but they're not drawn and don't interfere with the others in the Array.
    Friday, March 18, 2016 3:08 PM