示例#1
0
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     if (this.OnGestureDetected != null)
     {
         this.OnGestureDetected(this, new GestureEventArgs(false, false, 0.0f, "none"));
     }
 }
示例#2
0
 void trackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     //lock (thisLock) {
     //Console.WriteLine("Tracking lost: " + e.TrackingId);
     faceFrameSource[e.TrackingId] = null;
     faceFrameResult[e.TrackingId] = null;
     //}
 }
 void OnTrackingIdLost(object sender, TrackingIdLostEventArgs args)
 {
     if (this.facialState.ContainsKey(args.TrackingId))
     {
         this.facialState[args.TrackingId].Reader.Dispose();
         this.facialState.Remove(args.TrackingId);
     }
 }
示例#4
0
        private void RaiseBodyTrackingLostEvent(object sender, TrackingIdLostEventArgs args)
        {
            EventHandler <TrackingIdLostEventArgs> handler = TrackingIdLost;

            if (handler != null)
            {
                handler(sender, args);
            }
        }
        void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var faceTracker = this.FaceTrackers.FirstOrDefault(a => a.TrackingId == e.TrackingId);

            if (faceTracker != null)
            {
                faceTracker = new FaceTracker(Sensor, 0);
            }
        }
示例#6
0
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     lock (lockObj)
     {
         foreach (var gesture in GestureResults)
         {
             gesture.UpdateGestureResult("", false, false, 0.0f);
         }
     }
 }
        private void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var faceTracker = this.faceTrackers.FirstOrDefault(a => a.TrackingId == e.TrackingId);

            if (faceTracker != null)
            {
                faceTracker.ModelBuilder.Dispose();
                faceTracker.Source.TrackingId = 0;
            }
        }
        /// <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)));
        }
示例#9
0
    private void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
    {
        var lostTrackingID = e.TrackingId;

        if (CurrentTrackingId == lostTrackingID)
        {
            CurrentTrackingId  = 0;
            currentTrackedBody = null;

            FaceFrameSource.TrackingId = 0;
        }
    }
示例#10
0
        private void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var lostTrackingID = e.TrackingId;

            Console.WriteLine("Lost track of face: " + lostTrackingID.ToString());

            if (this.currentTrackingId == lostTrackingID)
            {
                this.currentTrackingId = 0;
                this.trackedBody       = null;

                this.hdFaceFrameSource.TrackingId = 0;
            }
        }
        /// <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>
        /// 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;
        }
示例#13
0
        private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            _vgbFrameReader.IsPaused = true;
            _vgbFrameReader.Dispose();
            _vgbFrameReader = null;

            _vgbFrameSource.Dispose();
            _vgbFrameSource.Dispose();

            var tmpTrackingIdLost = TrackingIdLost;

            if (tmpTrackingIdLost != null)
            {
                tmpTrackingIdLost(this, EventArgs.Empty);
            }
        }
示例#14
0
        private void HdFaceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var lostTrackingID = e.TrackingId;

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

                highDefinitionFaceFrameSource.TrackingId = 0;
            }
        }
示例#15
0
        // This event is fired when a tracking is lost for a
        // body tracked by HDFace Tracker

        private void HdFaceSource_TrackingIdLost(
            object sender, TrackingIdLostEventArgs e
            )
        {
            var lostTrackingID = e.TrackingId;

            if (_currentTrackingId == lostTrackingID)
            {
                _currentTrackingId  = 0;
                _currentTrackedBody = null;
                if (_faceModelBuilder != null)
                {
                    _faceModelBuilder.Dispose();
                    _faceModelBuilder = null;
                }

                _hdFaceFrameSource.TrackingId = 0;
            }
        }
        private void FaceFrameSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            FaceFrameReader reader;

            if (_FaceFrameReaders.TryGetValue(e.TrackingId, out reader))
            {
                FaceFrameSource source;
                if (_FaceFrameSources.TryGetValue(e.TrackingId, out source))
                {
                    reader.IsPaused      = true;
                    reader.FrameArrived -= FaceFrameReader_FrameArrived;
                    reader.Dispose();

                    source.TrackingIdLost -= FaceFrameSource_TrackingIdLost;
                    source.Dispose();

                    _FaceFrameReaders.Remove(e.TrackingId);
                    _FaceFrameSources.Remove(e.TrackingId);

                    if (_BodyManager.Count == 0)
                    {
                        _Continue = false;
                    }

                    RaiseBodyLost(e.TrackingId, _FaceFrameSources.Count);

                    Console.WriteLine("Tracker for bodyId {0} destroyed.", e.TrackingId);
                }
                else
                {
                    throw new BodyPhotoTakerInvalidStateException();
                }
            }
            else
            {
                throw new BodyPhotoTakerInvalidStateException();
            }
        }
示例#17
0
 void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     this.gestureReader.IsPaused = true;
     //this.moveableStop.Offset = 0.0f;
     //this.txtProgress.Text = string.Empty;
 }
示例#18
0
 /// <summary>
 /// This functions handles the results of the frame with gesture names
 /// A valid tracking ID is associated with the frames
 /// </summary>
 /// <param name="sender">Object which sends the events</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     this.GestureResultView.UpdateGestureResult(false, false, 0.0f);
 }
 /// <summary>
 /// Callback when person is becoming not tracked
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     Console.WriteLine("Id: {0}, Lost", e.TrackingId);
 }
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     // update the GestureResultView object to show the 'Not Tracked' image in the UI
     this.GestureResultView.UpdateGestureResult(false, false, 0.0f, "Not Tracked");
 }
示例#21
0
 private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     _BodyManager.RemoveEngagedBody(e.TrackingId);
     //_BodyManager.RemoveEngagedBody(e.TrackingId);
 }
示例#22
0
 private void _faceSource_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     Console.WriteLine("Losty tracking " + e.TrackingId);
 }
示例#23
0
        /// <summary>
        /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            var arguments = new ChangedEventArgs();

            OnGestureDetected(arguments);
        }
示例#24
0
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     // update the GestureResultView object to show the 'Not Tracked' image in the UI
     this.StandingResultView.UpdateStandingResult(false, false, 0.0f);
     this.ArmsCrossedResultView.UpdateArmsCrossedResult(false, false, 0.0f);
 }
示例#25
0
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
 }
示例#26
0
        }//reader gesture frame arrived

        /// <summary>
        /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            this.GestureResultView.UpdateGestureResult(false, false, 0.0f, "null");
            direction = 0;
        }//sourcetrackingidlost
示例#27
0
 /// <summary>
 /// FaceTrackingの対象をロストしたときのイベントを処理します
 /// </summary>
 private void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     // faceReaderとfaceSourceを初期化して次のトラッキングに備える
     //this.isCaptured = false;
     this.hdFaceFrameSource.TrackingId = 0;
 }
示例#28
0
 void OnTrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     this._gestureReader.IsPaused = true;
 }
示例#29
0
 /// <summary>
 /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
 /// 处理VisualGestureBuilderSource对象的TrackingIdLost事件
 /// </summary>
 /// <param name="sender">object sending the event</param>
 /// <param name="e">event arguments</param>
 private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
 {
     // update the GestureResultView object to show the 'Not Tracked' image in the UI
     // 更新GestureResultView对象以在UI中显示“未跟踪”图像
     this.GestureResultView.UpdateGestureResult(false, false, 0.0f);
 }
示例#30
0
        /// <summary>
        /// Handles the TrackingIdLost event for the VisualGestureBuilderSource object
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void Source_TrackingIdLost(object sender, TrackingIdLostEventArgs e)
        {
            // update the GestureResultView object to show the 'Not Tracked' image in the UI

            // TODO
        }