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
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
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