C# Класс AForge.Imaging.Filters.OrderedDithering

Binarization with thresholds matrix.

Idea of the filter is the same as idea of Threshold filter - change pixel value to white, if its intensity is equal or higher than threshold value, or to black otherwise. But instead of using single threshold value for all pixel, the filter uses matrix of threshold values. Processing image is divided to adjacent windows of matrix size each. For pixels binarization inside of each window, corresponding threshold values are used from specified threshold matrix.

The filter accepts 8 bpp grayscale images for processing.

Sample usage:

// create binarization matrix byte[,] matrix = new byte[4, 4] { { 95, 233, 127, 255 }, { 159, 31, 191, 63 }, { 111, 239, 79, 207 }, { 175, 47, 143, 15 } }; // create filter OrderedDithering filter = new OrderedDithering( matrix ); // apply the filter filter.ApplyInPlace( image );

Initial image:

Result image:

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

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

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

Initializes a new instance of the OrderedDithering class.

OrderedDithering ( byte matrix ) : System

Initializes a new instance of the OrderedDithering class.

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

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

Process the filter on the specified image.

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

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

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

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

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

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