Accord.Imaging.Moments.CentralMoments.Compute C# (CSharp) Méthode

Compute() public méthode

Computes the center moments for the specified image.
public Compute ( float image, Rectangle area ) : void
image float The image.
area System.Drawing.Rectangle The region of interest in the image to compute moments for.
Résultat void
        public override void Compute(float[,] image, Rectangle area)
        {
            this.Compute(new RawMoments(image, area, Order));
        }

Same methods

CentralMoments::Compute ( RawMoments moments ) : void
CentralMoments::Compute ( UnmanagedImage image, Rectangle area ) : void

Usage Example

Exemple #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;
            }
        }