none
Skeleton Exiting View RRS feed

  • Question

  • Hello.

     

    I'm a student, and this question may quite possibly be silly, but I'd very much appreciate any assistance.

     

    I'm currently enjoy the SDK and have run into a problem that I am unsure how to over come with ease (and maybe there is no simple method).

     

    I was trying to figure out how to check for when a skeleton exits the viewable area.

     

    In the skeleton viewer example, it just squishes the skeleton and leaves it on the side, giving it a value of still tracked.

    I've also tried to check for clip left or clip right when exiting the viewable area, however other objects in the room trigger this event.

     

    I believe my answer may lie in the ShapeGame example, as they do remove characters. However, they use a value (DateTime) and track how long since the last update has been, and seem to require jumping through a few hoops. Also, I don't quite understand if whether or not the skeleton is still being tracked and simply ignored.

     

    Ideally I'd like to do something along the lines of

    nui_SkeletonFrameReady(blah blah)

    {

                bool NoSkeletonsOnScreen = true;

                foreach (SkeletonData data in skeletonFrame.Skeletons)
                {
                    if (SkeletonTrackingState.Tracked == data.TrackingState)
                        noSkeletonsOnScreen = false;
                }

          if(noSkeletonsOnScreen)

          //Display Picture of Clown

    }

    The reason this code will not work, is because there "is" a mangled skeleton on the screen which the kinect is "tracking", even if all persons has entered and left.

    Thanks very much for any assistance.

     

    -Mathieu

    Thursday, June 23, 2011 9:25 AM

Answers

  • The way the shape game example does this is to check the joints.count.  An inactive player (offscreen) has a joint count of zero.

    It then calculates whether the player has been inactive for more than 500 milliseconds and removes the player visuals if so -- actually, since the shape game clears and redraws everything on a game loop, it simply doesn't redraw the stick figure.

    The one trick to all this is you don't want to put any of this logic inside your SkeletonFrameReady event handler.  If there's no player, the event is simply thrown.  You need to have a separate loop to check for orphaned visuals.

     


    James Ashley - Presentation Layer Architect at Razorfish Emerging Experiences
    jamesashley@imaginativeuniversal.com
    www.imaginativeuniversal.com www.emergingexperiences.com
    Sunday, June 26, 2011 6:48 PM

All replies

  • I noticed the same thing when i was fooling with the SDK and i was wondering if there is a solution. I haven't looked into it yet but have you looked at the value of W on the joints that are getting clipped? I'm wondering if this would be a case when the W would be less than 1(1 meaning the the accuracy is high) I believe it is Joint.Position.W or something similar. I'm not at home to test this but if you don't get there,ill check it out tonight.

    Thursday, June 23, 2011 4:04 PM
  • I haven't taken a look at W, however I feel as if it would run into similar problems of the "Quality"'s ClippedLeft and ClippedRight, where it would accidentally trigger before actually exiting the picture. I'll give it a whirl later today though.
    Thursday, June 23, 2011 4:36 PM
  • I can't for the life of me to get W != 1. I specifically had it just check the W of my right hand and it was 1 on screen, hidden on screen, and when I left the room.

    Thursday, June 23, 2011 8:12 PM
  • damn, i was hoping thats what its used for...anyone ever see W != 1??? I'm still curious if there is a way to tell if its getting clipped like in the scenario the OP talked about...
    Thursday, June 23, 2011 11:56 PM
  • The way the shape game example does this is to check the joints.count.  An inactive player (offscreen) has a joint count of zero.

    It then calculates whether the player has been inactive for more than 500 milliseconds and removes the player visuals if so -- actually, since the shape game clears and redraws everything on a game loop, it simply doesn't redraw the stick figure.

    The one trick to all this is you don't want to put any of this logic inside your SkeletonFrameReady event handler.  If there's no player, the event is simply thrown.  You need to have a separate loop to check for orphaned visuals.

     


    James Ashley - Presentation Layer Architect at Razorfish Emerging Experiences
    jamesashley@imaginativeuniversal.com
    www.imaginativeuniversal.com www.emergingexperiences.com
    Sunday, June 26, 2011 6:48 PM
  • Mathieu,

    Unfortunately, there is no clear cut, simple to handle event to do what you want, so you'll have to use one of the workarounds mentioned in this thread. I've recorded your feedback.

    Thanks for your interest,
    Eddy


    I'm here to help
    Wednesday, June 29, 2011 12:30 AM