C# Class AForge.Imaging.Filters.Closing

Closing operator from Mathematical Morphology.

Closing morphology operator equals to dilatation followed by erosion.

Applied to binary image, the filter may be used connect or fill objects. Since dilatation is used first, it may connect/fill object areas. Then erosion restores objects. But since dilatation may connect something before, erosion may not remove after that because of the formed connection.

See documentation to Erosion and Dilatation classes for more information and list of supported pixel formats.

Sample usage:

// create filter Closing filter = new Closing( ); // apply the filter filter.Apply( image );

Initial image:

Result image:

Inheritance: IFilter, IInPlaceFilter, IInPlacePartialFilter, IFilterInformation
ファイルを表示 Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
Apply ( Bitmap image ) : Bitmap

Apply filter to an image.

The method keeps the source image unchanged and returns the result of image processing filter as new image.

Apply ( BitmapData imageData ) : Bitmap

Apply filter to an image.

The filter accepts bitmap data as input and returns the result of image processing filter as new image. The source image data are kept unchanged.

Apply ( UnmanagedImage image ) : UnmanagedImage

Apply filter to an image in unmanaged memory.

The method keeps the source image unchanged and returns the result of image processing filter as new image.

Apply ( UnmanagedImage sourceImage, UnmanagedImage destinationImage ) : void

Apply filter to an image in unmanaged memory.

The method keeps the source image unchanged and puts result of image processing into destination image.

The destination image must have the same width and height as source image. Also destination image must have pixel format, which is expected by particular filter (see FormatTranslations property for information about pixel format conversions).

ApplyInPlace ( Bitmap image ) : void

Apply filter to an image.

The method applies the filter directly to the provided source image.

ApplyInPlace ( Bitmap image, Rectangle rect ) : void

Apply filter to an image or its part.

The method applies the filter directly to the provided source image.

ApplyInPlace ( BitmapData imageData ) : void

Apply filter to an image.

The method applies the filter directly to the provided source image.

ApplyInPlace ( BitmapData imageData, Rectangle rect ) : void

Apply filter to an image or its part.

The method applies the filter directly to the provided source image.

ApplyInPlace ( UnmanagedImage image ) : void

Apply filter to an unmanaged image.

The method applies the filter directly to the provided source unmanaged image.

ApplyInPlace ( UnmanagedImage image, Rectangle rect ) : void

Apply filter to an unmanaged image or its part.

The method applies the filter directly to the provided source image.

Closing ( ) : System

Initializes a new instance of the Closing class.

Initializes new instance of the Closing class using default structuring element for both Erosion and Dilatation classes - 3x3 structuring element with all elements equal to 1.

Closing ( short se ) : System

Initializes a new instance of the Closing class.

See documentation to Erosion and Dilatation classes for information about structuring element constraints.

Method Details

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

Apply() public method

Apply filter to an image.
The filter accepts bitmap data as input and returns the result of image processing filter as new image. The source image data are kept unchanged.
public Apply ( BitmapData imageData ) : Bitmap
imageData System.Drawing.Imaging.BitmapData Source image to apply filter to.
return System.Drawing.Bitmap

Apply() public method

Apply filter to an image in unmanaged memory.
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 ( UnmanagedImage image ) : UnmanagedImage
image UnmanagedImage Source image in unmanaged memory to apply filter to.
return UnmanagedImage

Apply() public method

Apply filter to an image in unmanaged memory.

The method keeps the source image unchanged and puts result of image processing into destination image.

The destination image must have the same width and height as source image. Also destination image must have pixel format, which is expected by particular filter (see FormatTranslations property for information about pixel format conversions).

Unsupported pixel format of the source image. Incorrect destination pixel format. Destination image has wrong width and/or height.
public Apply ( UnmanagedImage sourceImage, UnmanagedImage destinationImage ) : void
sourceImage UnmanagedImage Source image in unmanaged memory to apply filter to.
destinationImage UnmanagedImage Destination image in unmanaged memory to put result into.
return void

ApplyInPlace() public method

Apply filter to an image.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( Bitmap image ) : void
image System.Drawing.Bitmap Image to apply filter to.
return void

ApplyInPlace() public method

Apply filter to an image or its part.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( Bitmap image, Rectangle rect ) : void
image System.Drawing.Bitmap Image to apply filter to.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
return void

ApplyInPlace() public method

Apply filter to an image.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( BitmapData imageData ) : void
imageData System.Drawing.Imaging.BitmapData Image data to apply filter to.
return void

ApplyInPlace() public method

Apply filter to an image or its part.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( BitmapData imageData, Rectangle rect ) : void
imageData System.Drawing.Imaging.BitmapData Image data to apply filter to.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
return void

ApplyInPlace() public method

Apply filter to an unmanaged image.
The method applies the filter directly to the provided source unmanaged image.
Unsupported pixel format of the source image.
public ApplyInPlace ( UnmanagedImage image ) : void
image UnmanagedImage Unmanaged image to apply filter to.
return void

ApplyInPlace() public method

Apply filter to an unmanaged image or its part.
The method applies the filter directly to the provided source image.
Unsupported pixel format of the source image.
public ApplyInPlace ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Unmanaged image to apply filter to.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
return void

Closing() public method

Initializes a new instance of the Closing class.

Initializes new instance of the Closing class using default structuring element for both Erosion and Dilatation classes - 3x3 structuring element with all elements equal to 1.

public Closing ( ) : System
return System

Closing() public method

Initializes a new instance of the Closing class.

See documentation to Erosion and Dilatation classes for information about structuring element constraints.

public Closing ( short se ) : System
se short Structuring element.
return System