Accord.Imaging.FastCornersDetector.ProcessImage C# (CSharp) Method

ProcessImage() public method

Process image looking for corners.
/// The source image has incorrect pixel format. ///
public ProcessImage ( Bitmap image ) : List
image System.Drawing.Bitmap Source image data to process.
return List
        public List<IntPoint> ProcessImage(Bitmap image)
        {
            // check image format
            if (
                (image.PixelFormat != PixelFormat.Format8bppIndexed) &&
                (image.PixelFormat != PixelFormat.Format24bppRgb) &&
                (image.PixelFormat != PixelFormat.Format32bppRgb) &&
                (image.PixelFormat != PixelFormat.Format32bppArgb)
                )
            {
                throw new UnsupportedImageFormatException("Unsupported pixel format of the source");
            }

            // lock source image
            BitmapData imageData = image.LockBits(
                new Rectangle(0, 0, image.Width, image.Height),
                ImageLockMode.ReadOnly, image.PixelFormat);

            List<IntPoint> corners;

            try
            {
                // process the image
                corners = ProcessImage(new UnmanagedImage(imageData));
            }
            finally
            {
                // unlock image
                image.UnlockBits(imageData);
            }

            return corners;
        }

Same methods

FastCornersDetector::ProcessImage ( BitmapData imageData ) : List
FastCornersDetector::ProcessImage ( UnmanagedImage image ) : List

Usage Example

        /// <summary>
        /// Features from Accelerated Segment Test (FAST) corners detector.
        /// <para>Accord.NET internal call. Please see: <see cref="Accord.Imaging.FastCornersDetector"/> for details.</para>
        /// </summary>
        /// <param name="im">Image.</param>
        /// <param name="threshold">The suppression threshold. Decreasing this value increases the number of points detected by the algorithm.</param>
        /// <returns>Interest point locations.</returns>
        public static List<IntPoint> CornerFeaturesDetector(this Image<Gray, byte> im, int threshold = 20)
        {
            FastCornersDetector fast = new FastCornersDetector(threshold);
            var points = fast.ProcessImage(im.ToAForgeImage(copyAlways: false, failIfCannotCast: true));

            return points;
        }
All Usage Examples Of Accord.Imaging.FastCornersDetector::ProcessImage