C# Class Accord.Imaging.Filters.OilPainting

Oil painting filter.

Processing source image the filter changes each pixels' value to the value of pixel with the most frequent intensity within window of the specified size. Going through the window the filters finds which intensity of pixels is the most frequent. Then it updates value of the pixel in the center of the window to the value with the most frequent intensity. The update procedure creates the effect of oil painting.

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

Sample usage:

// create filter OilPainting filter = new OilPainting( 15 ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

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

Public Methods

Method Description
OilPainting ( ) : System

Initializes a new instance of the OilPainting class.

OilPainting ( int brushSize ) : System

Initializes a new instance of the OilPainting class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

OilPainting() public method

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

OilPainting() public method

Initializes a new instance of the OilPainting class.
public OilPainting ( int brushSize ) : System
brushSize int Brush size.
return System

ProcessFilter() protected method

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