Exemplo n.º 1
0
        private void BodyTrackingStarted(object sender, KinectBodyEventArgs e)
        {
            if (this.idleProcessors.Count > 0)
            {
                var processor = this.idleProcessors[this.idleProcessors.Count - 1];
                processor.HdFrameReceived += HdFrameReceived;
                processor.AssignBody(e.Body);


                this.idleProcessors.RemoveAt(this.idleProcessors.Count - 1);
                this.activeProcessors.Add(e.Body.TrackingId, processor);
            }
        }
Exemplo n.º 2
0
        private void BodyTrackingLost(object sender, KinectBodyEventArgs e)
        {
            if (this.activeProcessors.ContainsKey(e.Body.TrackingId))
            {
                var processor = this.activeProcessors[e.Body.TrackingId];
                processor.HdFrameReceived -= HdFrameReceived;
                processor.Suspend();

                this.activeProcessors.Remove(e.Body.TrackingId);
                this.idleProcessors.Add(processor);

                //Remove from tracked list if relevant
                if (this.currentResults.ContainsKey(e.Body.TrackingId))
                {
                    this.currentResults.Remove(e.Body.TrackingId);
                    this.RaiseTrackingResultsChanged();
                }
            }
        }
Exemplo n.º 3
0
        private void BodyTrackingStarted(object sender, KinectBodyEventArgs e)
        {
            if (this.idleProcessors.Count > 0)
            {
                var processor = this.idleProcessors[this.idleProcessors.Count - 1];
                processor.HdFrameReceived += HdFrameReceived;
                processor.AssignBody(e.Body);

                this.idleProcessors.RemoveAt(this.idleProcessors.Count - 1);
                this.activeProcessors.Add(e.Body.TrackingId, processor);
            }
        }
Exemplo n.º 4
0
        private void BodyTrackingLost(object sender, KinectBodyEventArgs e)
        {
            if (this.activeProcessors.ContainsKey(e.Body.TrackingId))
            {
                var processor = this.activeProcessors[e.Body.TrackingId];
                processor.HdFrameReceived -= HdFrameReceived;
                processor.Suspend();

                this.activeProcessors.Remove(e.Body.TrackingId);
                this.idleProcessors.Add(processor);

                //Remove from tracked list if relevant
                if (this.currentResults.ContainsKey(e.Body.TrackingId))
                {
                    this.currentResults.Remove(e.Body.TrackingId);
                    this.RaiseTrackingResultsChanged();
                }
            }
        }