Accord.Vision.Tracking.TrackingObject.Reset C# (CSharp) Method

Reset() public method

Resets this tracking object.
public Reset ( ) : void
return void
        public void Reset()
        {
            this.Rectangle = Rectangle.Empty;
            this.Center = new IntPoint();
            this.Image = null;
            this.Angle = 0;
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Process a new video frame.
        /// </summary>
        public void ProcessFrame(UnmanagedImage frame)
        {
            filterImage = filter.Apply(frame);

            Blob blob = extractBlob();

            if (blob == null)
            {
                trackingObject.Reset();
                return;
            }


            trackingObject.Rectangle = blob.Rectangle;
            trackingObject.Center    = (IntPoint)blob.CenterOfGravity;

            if (rotation)
            {
                // Locate moments
                CentralMoments moments = new CentralMoments();
                moments.Compute(filterImage, blob.Rectangle);
                trackingObject.Angle = moments.GetOrientation();
            }


            if (extract)
            {
                blobCounter.ExtractBlobsImage(filterImage, blob, false);
                trackingObject.Image = blob.Image;
            }
        }