Click or drag to resize
Accord.NET (logo)

OtsuThresholdCalculateThreshold Method (Bitmap, Rectangle)

Calculate binarization threshold for the given image.

Namespace:  Accord.Imaging.Filters
Assembly:  Accord.Imaging (in Accord.Imaging.dll) Version: 3.7.0
Syntax
public int CalculateThreshold(
	Bitmap image,
	Rectangle rect
)
Request Example View Source

Parameters

image
Type: System.DrawingBitmap
Image to calculate binarization threshold for.
rect
Type: System.DrawingRectangle
Rectangle to calculate binarization threshold for.

Return Value

Type: Int32
Returns binarization threshold.
Exceptions
ExceptionCondition
UnsupportedImageFormatExceptionSource pixel format is not supported by the routine. It should be 8 bpp grayscale (indexed) image.
Remarks

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

See Also