C# Класс 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:

Наследование: BaseUsingCopyPartialFilter
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ConservativeSmoothing ( ) : System

Initializes a new instance of the ConservativeSmoothing class.

ConservativeSmoothing ( int size ) : System

Initializes a new instance of the ConservativeSmoothing class.

Защищенные методы

Метод Описание
ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData, Rectangle rect ) : void

Process the filter on the specified image.

Описание методов

ConservativeSmoothing() публичный Метод

Initializes a new instance of the ConservativeSmoothing class.
public ConservativeSmoothing ( ) : System
Результат System

ConservativeSmoothing() публичный Метод

Initializes a new instance of the ConservativeSmoothing class.
public ConservativeSmoothing ( int size ) : System
size int Kernel size.
Результат System

ProcessFilter() защищенный Метод

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.
Результат void