/// <summary> /// Event Skeleton für PeopleDetector. /// </summary> private void PeopleDetectorSkeletonEvent(object sender, EventArgs e) { _peopleDetector.TrackSkeletons(KinectHelper.Instance.Skeletons); /*if (_mainWindow == null) * { * OutputLabelX.Content = * "Erkannt:" + _peopleDetector.GetPositionOnlyPeople().Count + * " Tracked:" + _peopleDetector.GetTrackedPeople().Count + * " Walking:" + _peopleDetector.GetWalkingPeople().Count + * " Standing:" + _peopleDetector.GetStayingPeople().Count + * " Looking:" + _peopleDetector.GetLookingPeople().Count; * } * else * { * OutputLabelX.Content = * "Erkannt:" + _peopleDetector.GetPositionOnlyPeople().Count + * " Tracked:" + _peopleDetector.GetTrackedPeople().Count + * " Walking:" + _peopleDetector.GetWalkingPeople().Count + * " Standing:" + _peopleDetector.GetStayingPeople().Count + * " Looking:" + _peopleDetector.GetLookingPeople().Count + * " Gender:" + _mainWindow.Gender; * }*/ ChangeScreen(); }
/// <summary> /// Event handler for Kinect sensor's SkeletonFrameReady event /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) { Skeleton[] skeletons = new Skeleton[0]; using (SkeletonFrame skeletonFrame = e.OpenSkeletonFrame()) { if (skeletonFrame != null) { skeletons = new Skeleton[skeletonFrame.SkeletonArrayLength]; skeletonFrame.CopySkeletonDataTo(skeletons); } } peopleDetector.TrackSkeletons(skeletons); this.LblErkanntOutput.Content = peopleDetector.GetPositionOnlyPeople().Count; this.LblTrackedOutput.Content = peopleDetector.GetTrackedPeople().Count; this.LblLaufenOutput.Content = peopleDetector.GetWalkingPeople().Count; this.LblStehenOutput.Content = peopleDetector.GetStayingPeople().Count; this.LblSchauenOutput.Content = peopleDetector.GetLookingPeople().Count; }