C# Class Accord.Imaging.Filters.FillHoles

Fill holes in objects in binary image.

The filter allows to fill black holes in white object in a binary image. It is possible to specify maximum holes' size to fill using MaxHoleWidth and MaxHoleHeight properties.

The filter accepts binary image only, which are represented as 8 bpp images.

Sample usage:

// create and configure the filter FillHoles filter = new FillHoles( ); filter.MaxHoleHeight = 20; filter.MaxHoleWidth = 20; filter.CoupledSizeFiltering = false; // apply the filter Bitmap result = filter.Apply( image );

Initial image:

Result image:

Inheritance: BaseInPlaceFilter
显示文件 Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
FillHoles ( ) : System

Initializes a new instance of the FillHoles class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image ) : void

Process the filter on the specified image.

Method Details

FillHoles() public method

Initializes a new instance of the FillHoles class.
public FillHoles ( ) : System
return System

ProcessFilter() protected method

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image ) : void
image UnmanagedImage Source image data.
return void