C# Class Accord.Imaging.Filters.ColorFiltering

Color filtering.

The filter filters pixels inside/outside of specified RGB color range - it keeps pixels with colors inside/outside of specified range and fills the rest with specified color.

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

Sample usage:

// create filter ColorFiltering filter = new ColorFiltering( ); // set color ranges to keep filter.Red = new IntRange( 100, 255 ); filter.Green = new IntRange( 0, 75 ); filter.Blue = new IntRange( 0, 75 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

Inheritance: BaseInPlacePartialFilter
Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
ColorFiltering ( ) : System

Initializes a new instance of the ColorFiltering class.

ColorFiltering ( IntRange red, IntRange green, IntRange blue ) : System

Initializes a new instance of the ColorFiltering class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

ColorFiltering() public method

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

ColorFiltering() public method

Initializes a new instance of the ColorFiltering class.
public ColorFiltering ( IntRange red, IntRange green, IntRange blue ) : System
red AForge.IntRange Red components filtering range.
green AForge.IntRange Green components filtering range.
blue AForge.IntRange Blue components filtering range.
return System

ProcessFilter() protected method

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
return void