Accord.Imaging.Filters.Opening.Apply C# (CSharp) Method

Apply() public method

Apply filter to an image.
The method keeps the source image unchanged and returns the result of image processing filter as new image.
Unsupported pixel format of the source image.
public Apply ( Bitmap image ) : Bitmap
image System.Drawing.Bitmap Source image to apply filter to.
return System.Drawing.Bitmap
        public Bitmap Apply( Bitmap image )
        {
            Bitmap tempImage = errosion.Apply( image );
            Bitmap destImage = dilatation.Apply( tempImage );

            tempImage.Dispose( );

            return destImage;
        }

Same methods

Opening::Apply ( BitmapData imageData ) : Bitmap
Opening::Apply ( UnmanagedImage image ) : UnmanagedImage
Opening::Apply ( UnmanagedImage sourceImage, UnmanagedImage destinationImage ) : void

Usage Example

Beispiel #1
0
        /// <summary>
        /// Process the filter on the specified image.
        /// </summary>
        ///
        /// <param name="image">Source image data.</param>
        ///
        protected override unsafe void ProcessFilter(UnmanagedImage image)
        {
            // perform opening on the source image
            UnmanagedImage openedImage = opening.Apply(image);

            // subtract opened image from source image
            subtract.UnmanagedOverlayImage = openedImage;
            subtract.ApplyInPlace(image);

            openedImage.Dispose( );
        }