C# Class AForge.Imaging.Filters.BlobsFiltering

Blobs filtering by size.

The filter performs filtering of blobs by their size in the specified source image - all blobs, which are smaller or bigger then specified limits, are removed from the image.

The image processing filter treats all none black pixels as objects' pixels and all black pixel as background.

The filter accepts 8 bpp grayscale images and 24/32 color images for processing.

Sample usage:

// create filter BlobsFiltering filter = new BlobsFiltering( ); // configure filter filter.CoupledSizeFiltering = true; filter.MinWidth = 70; filter.MinHeight = 70; // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseInPlaceFilter
Exibir arquivo Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
BlobsFiltering ( ) : System

Initializes a new instance of the BlobsFiltering class.

BlobsFiltering ( IBlobsFilter blobsFilter ) : System

Initializes a new instance of the BlobsFiltering class.

BlobsFiltering ( int minWidth, int minHeight, int maxWidth, int maxHeight ) : System

Initializes a new instance of the BlobsFiltering class.

This constructor creates an instance of BlobsFiltering class with CoupledSizeFiltering property set to false.

BlobsFiltering ( int minWidth, int minHeight, int maxWidth, int maxHeight, bool coupledSizeFiltering ) : System

Initializes a new instance of the BlobsFiltering class.

For information about coupled filtering mode see documentation for BlobCounterBase.CoupledSizeFiltering property of BlobCounterBase class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image ) : void

Process the filter on the specified image.

Method Details

BlobsFiltering() public method

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

BlobsFiltering() public method

Initializes a new instance of the BlobsFiltering class.
public BlobsFiltering ( IBlobsFilter blobsFilter ) : System
blobsFilter IBlobsFilter Custom blobs' filtering routine to use /// (see ).
return System

BlobsFiltering() public method

Initializes a new instance of the BlobsFiltering class.
This constructor creates an instance of BlobsFiltering class with CoupledSizeFiltering property set to false.
public BlobsFiltering ( int minWidth, int minHeight, int maxWidth, int maxHeight ) : System
minWidth int Minimum allowed width of blob.
minHeight int Minimum allowed height of blob.
maxWidth int Maximum allowed width of blob.
maxHeight int Maximum allowed height of blob.
return System

BlobsFiltering() public method

Initializes a new instance of the BlobsFiltering class.

For information about coupled filtering mode see documentation for BlobCounterBase.CoupledSizeFiltering property of BlobCounterBase class.

public BlobsFiltering ( int minWidth, int minHeight, int maxWidth, int maxHeight, bool coupledSizeFiltering ) : System
minWidth int Minimum allowed width of blob.
minHeight int Minimum allowed height of blob.
maxWidth int Maximum allowed width of blob.
maxHeight int Maximum allowed height of blob.
coupledSizeFiltering bool Specifies if size filetering should be coupled or not.
return System

ProcessFilter() protected method

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