Binarization with thresholds matrix.

Namespace:  AForge.Imaging.Filters
Assembly:  AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public class OrderedDithering : BaseInPlacePartialFilter

Remarks

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:

CopyC#
// 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:

Inheritance Hierarchy

See Also