C# Class Accord.Imaging.Filters.YCbCrFiltering

Color filtering in YCbCr color space.

The filter operates in YCbCr color space and filters pixels, which color is inside/outside of the specified YCbCr range - it keeps pixels with colors inside/outside of the specified range and fills the rest with specified color.

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

Sample usage:

// create filter YCbCrFiltering filter = new YCbCrFiltering( ); // set color ranges to keep filter.Cb = new Range( -0.2f, 0.0f ); filter.Cr = new Range( 0.26f, 0.5f ); // 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
YCbCrFiltering ( ) : System

Initializes a new instance of the YCbCrFiltering class.

YCbCrFiltering ( Range yRange, Range cbRange, Range crRange ) : System

Initializes a new instance of the YCbCrFiltering class.

Protected Methods

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

Process the filter on the specified image.

Method Details

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

YCbCrFiltering() public method

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

YCbCrFiltering() public method

Initializes a new instance of the YCbCrFiltering class.
public YCbCrFiltering ( Range yRange, Range cbRange, Range crRange ) : System
yRange AForge.Range Range of Y component.
cbRange AForge.Range Range of Cb component.
crRange AForge.Range Range of Cr component.
return System