C# Class AForge.Imaging.Filters.ConservativeSmoothing

Conservative smoothing.

The filter implements conservative smoothing, which is a noise reduction technique that derives its name from the fact that it employs a simple, fast filtering algorithm that sacrifices noise suppression power in order to preserve the high spatial frequency detail (e.g. sharp edges) in an image. It is explicitly designed to remove noise spikes - isolated pixels of exceptionally low or high pixel intensity (salt and pepper noise).

If the filter finds a pixel which has minimum/maximum value compared to its surrounding pixel, then its value is replaced by minimum/maximum value of those surrounding pixel. For example, lets suppose the filter uses kernel size of 3x3, which means each pixel has 8 surrounding pixel. If pixel's value is smaller than any value of surrounding pixels, then the value of the pixel is replaced by minimum value of those surrounding pixels.

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

Sample usage:

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

Initial image:

Result image:

Inheritance: BaseUsingCopyPartialFilter
Show file Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
ConservativeSmoothing ( ) : System

Initializes a new instance of the ConservativeSmoothing class.

ConservativeSmoothing ( int size ) : System

Initializes a new instance of the ConservativeSmoothing class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage source, UnmanagedImage destination, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

ConservativeSmoothing() public method

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

ConservativeSmoothing() public method

Initializes a new instance of the ConservativeSmoothing class.
public ConservativeSmoothing ( int size ) : System
size int Kernel size.
return System

ProcessFilter() protected method

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