Click or drag to resize
Accord.NET (logo)

IterativeThresholdCalculateThreshold Method (UnmanagedImage, Rectangle)

Calculate binarization threshold for the given image.

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

Parameters

image
Type: Accord.ImagingUnmanagedImage
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 8 bpp grayscale (indexed) or 16 bpp grayscale 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