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

Threshold binarization.

The filter does image binarization using specified threshold value. All pixels with intensities equal or higher than threshold value are converted to white pixels. All other pixels with intensities below threshold value are converted to black pixels.

The filter accepts 8 and 16 bpp grayscale images for processing.

Since the filter can be applied as to 8 bpp and to 16 bpp images, the ThresholdValue value should be set appropriately to the pixel format. In the case of 8 bpp images the threshold value is in the [0, 255] range, but in the case of 16 bpp images the threshold value is in the [0, 65535] range.

Sample usage:

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

Initial image:

Result image:

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

Защищенные свойства (Protected)

Свойство Тип Описание
threshold int

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

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

Initializes a new instance of the Threshold class.

Threshold ( int threshold ) : System

Initializes a new instance of the Threshold class.

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

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

Process the filter on the specified image.

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

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

Process the filter on the specified image.
protected ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void
image UnmanagedImage Source image data.
rect System.Drawing.Rectangle Image rectangle for processing by the filter.
Результат void

Threshold() публичный метод

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

Threshold() публичный метод

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

Описание свойств

threshold защищенное свойство

Threshold value.
protected int threshold
Результат int