Coffeehouse Thread

6 posts

Who Kinect see? Counting.

Back to Forum: Coffeehouse
  • User profile image
    Zerutreck

    Hello,

    This is my first week developing to Kinect SDK. I already did this http://channel9.msdn.com/Series/KinectQuickstart/Skeletal-Tracking-Fundamentals

    I never developing anything to Microsoft, only for Linux. Kinect changed this at me.

    My doubt is how can i see and count all people in front at Kinect? I dont need to track, only count ,all people pass in front at Kinect.

    Kind regards!

  • User profile image
    Maddus Mattus

    Hi Zerutreck!

    I suggest you post this question in that thread, not a lot of kinect developers here!

  • User profile image
    Ian2

    @Zerutreck:or maybe try the Tech Off forum rather than cofffeehouse?

    Best of luck.

  • User profile image
    Clint

    @Zerutreck: it can detect up to 6 people at a time with 2 skeleton locks.  Knowning a set of data is a person is basically tracking.  You know those data points belong to that person.

    6 people in the field of vision is a lot, believe it or not.  Back with beta 1 and testing out tracking, having 4 people in my office was tight.

    Have you played with the SDK?

  • User profile image
    Zerutreck

    Hello,

    I alredy resolve this.

     

     private int GetTotalSkeleton(AllFramesReadyEventArgs e)
            {
    
                using (SkeletonFrame skeletonFrameData = e.OpenSkeletonFrame())
                {
                    if (skeletonFrameData == null)
                    {
                        return 0;
                    }
    
    
                    skeletonFrameData.CopySkeletonDataTo(allSkeletons);
    
                    //Pessoas nao rastreados
                    int noTrac = (from s in allSkeletons
                                             where s.TrackingState == SkeletonTrackingState.PositionOnly
                                             select s).Count();
    
                    //Pessoas com esqueleto
                    int comEsq = (from s in allSkeletons
                                  where s.TrackingState == SkeletonTrackingState.Tracked
                                  select s).Count();
    
                    int numberOfSkeletons = noTrac + comEsq;
    
                    return numberOfSkeletons;
    
                }
    
            }

  • User profile image
    eddwo

    This is more compact

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
           private int GetTotalSkeleton(AllFramesReadyEventArgs e)
           {
               using (SkeletonFrame skeletonFrameData = e.OpenSkeletonFrame())
               {
                   if (skeletonFrameData == null) return 0;
                   skeletonFrameData.CopySkeletonDataTo(allSkeletons);
                   return  allSkeletons.Count(s => s.TrackingState != SkeletonTrackingState.NotTracked);
               }
           }

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.