C# Класс Accord.Imaging.Filters.Median

Median filter.

The median filter is normally used to reduce noise in an image, somewhat like the mean filter. However, it often does a better job than the mean filter of preserving useful detail in the image.

Each pixel of the original source image is replaced with the median of neighboring pixel values. The median is calculated by first sorting all the pixel values from the surrounding neighborhood into numerical order and then replacing the pixel being considered with the middle pixel value.

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

Sample usage:

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

Initial image:

Result image:

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

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

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

Initializes a new instance of the Median class.

Median ( int size ) : System

Initializes a new instance of the Median class.

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

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

Process the filter on the specified image.

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

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

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

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

Initializes a new instance of the Median class.
public Median ( int size ) : System
size int Processing square 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