/// <summary>
 /// FaceTrackingの対象をロストしたときのイベントを処理します
 /// </summary>
 private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     // faceReaderとfaceSourceを初期化して次のトラッキングに備える
     //this.isCaptured = false;
     this.hdFaceFrameSource.TrackingId = 0;
 }
Exemple #2
0
        /// <summary>
        /// This event is fired when a tracking is lost for a body tracked by HDFace Tracker
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var lostTrackingID = e.TrackingId;

            if (this.currentTrackingId == lostTrackingID)
            {
                this.currentTrackingId = 0;
                this.currentTrackedBody = null;
                if (this.faceModelBuilder != null)
                {
                    this.faceModelBuilder.Dispose();
                    this.faceModelBuilder = null;
                }

                this.highDefinitionFaceFrameSource.TrackingId = 0;
            }
        }
        /// <summary>
        /// FaceTrackingの対象をロストしたときのイベントを処理します
        /// </summary>
        private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            // UIの更新
            this.Happy = "NONE";
            this.FaceEngagement = "NONE";
            this.Glasses = "NONE";
            this.LeftEyeClosed = "NONE";
            this.RightEyeClosed = "NONE";
            this.MouthOpen = "NONE";
            this.MouthMoved = "NONE";
            this.LookingAway = "NONE";

            //// faceReaderとfaceSourceを初期化して次のトラッキングに備える(初期化)
            //this.faceSource.TrackingId = 0;
            //this.isCaptured = false;
        }
        /// <summary>
        /// Handle when the tracked body is gone
        /// </summary>
        private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            // Update UI
            HappyResult.Text = "No face tracked";
            EngagedResult.Text = "No face tracked";
            GlassesResult.Text = "No face tracked";
            LeftEyeResult.Text = "No face tracked";
            RightEyeResult.Text = "No face tracked";
            MouthOpenResult.Text = "No face tracked";
            MouthMovedResult.Text = "No face tracked";
            LookingAwayResult.Text = "No face tracked";

            // Reset values for next body
            _faceReader = null;
            _faceSource = null;
        }
        /// <summary>
        /// We lost track of the body and analytics are generated
        /// </summary>
        private void OnTrackingLost(object sender, TrackingIdLostEventArgs e)
        {
            Console.WriteLine(String.Format("Tracker for body #{0} lost.", e.TrackingId));

            // Create analytics for each feature
            List<FaceFeatureAnalytics> featureAnalytics = _featureAnalytics.Values.Select(fft => FaceFeatureAnalytics.Analyse(fft, _bodyId)).ToList();

            // Notify listeners
            FaceAnalyticsAvailable(new FaceAnalytics(_kinectId, _bodyId, featureAnalytics, (DateTime.Now - _startTracking)));
        }
Exemple #6
0
 private void OnTrackingIdLost2(object sender, TrackingIdLostEventArgs e)
 {
     this.faceSource2.TrackingId = 0;
     DetectedPerson2 = false;
 }
Exemple #7
0
        private void HdFaceSource_TrackingIdLost2(object sender, TrackingIdLostEventArgs e)
        {
            var lostTrackingID = e.TrackingId;

            if (this.CurrentTrackingId == lostTrackingID)
            {
                this.CurrentTrackingId = 0;


                this.highDefinitionFaceFrameSource2.TrackingId = 0;

                DetectedPerson2 = false;

            }
        }