C# 클래스 AForge.Imaging.Filters.OtsuThreshold

Otsu thresholding.

The class implements Otsu thresholding, which is described in N. Otsu, "A threshold selection method from gray-level histograms", IEEE Trans. Systems, Man and Cybernetics 9(1), pp. 62–66, 1979.

This implementation instead of minimizing the weighted within-class variance does maximization of between-class variance, what gives the same result. The approach is described in this presentation.

The filter accepts 8 bpp grayscale images for processing.

Sample usage:

// create filter OtsuThreshold filter = new OtsuThreshold( ); // apply the filter filter.ApplyInPlace( image ); // check threshold value byte t = filter.ThresholdValue; // ...

Initial image:

Result image (calculated threshold is 97):

상속: BaseInPlacePartialFilter
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
CalculateThreshold ( Bitmap image, Rectangle rect ) : int

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

CalculateThreshold ( BitmapData image, Rectangle rect ) : int

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

CalculateThreshold ( UnmanagedImage image, Rectangle rect ) : int

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

OtsuThreshold ( ) : System

Initializes a new instance of the OtsuThreshold class.

보호된 메소드들

메소드 설명
ProcessFilter ( UnmanagedImage image, Rectangle rect ) : void

Process the filter on the specified image.

메소드 상세

CalculateThreshold() 공개 메소드

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

Source pixel format is not supported by the routine. It should be /// 8 bpp grayscale (indexed) image.
public CalculateThreshold ( Bitmap image, Rectangle rect ) : int
image System.Drawing.Bitmap Image to calculate binarization threshold for.
rect System.Drawing.Rectangle Rectangle to calculate binarization threshold for.
리턴 int

CalculateThreshold() 공개 메소드

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

Source pixel format is not supported by the routine. It should be /// 8 bpp grayscale (indexed) image.
public CalculateThreshold ( BitmapData image, Rectangle rect ) : int
image System.Drawing.Imaging.BitmapData Image to calculate binarization threshold for.
rect System.Drawing.Rectangle Rectangle to calculate binarization threshold for.
리턴 int

CalculateThreshold() 공개 메소드

Calculate binarization threshold for the given image.

The method is used to calculate binarization threshold only. The threshold later may be applied to the image using Threshold image processing filter.

Source pixel format is not supported by the routine. It should be /// 8 bpp grayscale (indexed) image.
public CalculateThreshold ( UnmanagedImage image, Rectangle rect ) : int
image UnmanagedImage Image to calculate binarization threshold for.
rect System.Drawing.Rectangle Rectangle to calculate binarization threshold for.
리턴 int

OtsuThreshold() 공개 메소드

Initializes a new instance of the OtsuThreshold class.
public OtsuThreshold ( ) : System
리턴 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