Coffeehouse Post

Single Post Permalink

View Thread: Who Kinect see? Counting.
  • 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;
    
                }
    
            }