C# Class Accord.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
Afficher le fichier Open project: accord-net/framework Class Usage Examples

Méthodes publiques

Méthode Description
ConservativeSmoothing ( ) : System

Initializes a new instance of the ConservativeSmoothing class.

ConservativeSmoothing ( int size ) : System

Initializes a new instance of the ConservativeSmoothing class.

Méthodes protégées

Méthode Description
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void

Process the filter on the specified image.

Method Details

ConservativeSmoothing() public méthode

Initializes a new instance of the ConservativeSmoothing class.
public ConservativeSmoothing ( ) : System
Résultat System

ConservativeSmoothing() public méthode

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

ProcessFilter() protected méthode

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.
Résultat void