none
Kinect - Skeleton tracking question -> only track one (the nearest) skeleton RRS feed

  • Question

  • Hey there,

    i am studying informatics and i am working for a software company. My new task is to maintain our Kinect Mouse Controll project.

    We are using it as a mouseemulation on fairs as an eyecatcher to present our software....

    My task is to reduce disturbing signals. Whenever people walk behind the person who controlls the kinect, the signal gets disturbed.

    But when i look at the code it seems to me like there is only one active skeleton at one time (the nearest), so everything should be fine (i guess) see this:

    ___________________________________________________________________________________________________________________________

    if (this.trackedSkeleton != null){

    // get the current index of the tracked skeleton

    for (int i = 0; i < this.skeletons.Lenght; i++){

    if (this.skeletons[i].TrackingID == this.trackedSkeleton.TrackingID) {

    playerIndex = i;

    updatedSkeleton = this.skeleton[i];

    break;

       }

      }

    }

    if (updatedSkeleton == null){

    // no tracked skeleton was found

    float closestDistance = 1000f;

    for (int i = 0; i < this.skeletons[i]; i++)

    var newSkeleton= this.skeletons[i];

    if (newSkeleton.Trackingstate != SkeletonTrackingState.NotTracked && newSkeleton.Position.Z < closestDistance)

    {

    closestDistance = newSkeleton.Position.Z;

    playerIndex = i;

    updatedSkeleton = this.Skeletons[i]

        }

      }

    }

    this.trackedSkeleton = updatedSkeleton;

    ___________________________________________________________________________________________________________________________

    My Question(s):

    - Am i overseeing something?

    - What is the best way to check wich/how many skeltons are tracked?

    thanx for some input!



    Edit: I allready found some intresting threads on that topic with usefull tipps, but too me it seems like nothing has to be done, if i read that code correctly. Good thing would be to prove that statement ;-)

    Friday, April 19, 2013 9:00 AM

All replies

  • If the person walking behind is very close to the first player, Kinect may consider them as 1 skeleton. This will cause parasite movement because Kinect may consider using some bodyparts of the second person.
    => solution would be to physically define a perimeter (fence, ducktape or stickers on the floor) around the player in order to prevent walkers to be too closed to the scene.

    Additionnally, when the 2nd person walks away, he may "steal" the TrackingID and Kinect will then give the 1er player a new trackingID
    => usually, I just select the closest Skeleton. So you could replace all the code by:

    this.trackedSkeleton = this.skeletons.skeletons
                            // get only tracked skeleton
                            .Where(skeleton => skeleton.TrackingState != SkeletonTrackingState.NotTracked)
                            // select the closest
                            .OrderBy(skeleton => skeleton.Position.Z).FirstOrDefault();)

    Hope this helps


    Vincent Guigui Innovative Technologies Expert at OCTO Technology MVP Kinect

    Friday, April 19, 2013 10:15 AM
  • => usually, I just select the closest Skeleton. So you could replace all the code by:

    this.trackedSkeleton = this.skeletons.skeletons
                            // get only tracked skeleton
                            .Where(skeleton => skeleton.TrackingState != SkeletonTrackingState.NotTracked)
                            // select the closest
                            .OrderBy(skeleton => skeleton.Position.Z).FirstOrDefault();)

    Hope this helps


    Vincent Guigui Innovative Technologies Expert at OCTO Technology MVP Kinect

     ...thanx for your quick respone GUI!

    i think i ll try to implement this. Maybe you will hear from me again ;-)

    But again thank your for the moment!!!

    Friday, April 19, 2013 11:56 AM