Core Optical, Inc.
OtsuThresholder GetThresholdBinaryMask Method Industrial Strength, Scientific Grade
Applies an Otsu thresholding operator to the data and returns the result as a BinaryMask object.

Namespace: PrecisionImage.BinarizationAndMorphology
Assembly: PrecisionImage (in PrecisionImage.dll) Version: (

public BinaryMask GetThresholdBinaryMask(
	SourceData sourceData,
	int channel,
	HistogramResolution histogramResolution,
	Int32Rect regionOfInterest = null,
	BinaryMask binaryMask = null


Type: PrecisionImage SourceData
A SourceData object containing the data to operate on.
Type: OnlineSystem Int32
An OnlineInt32 type indicating the channel to operate on.
Type: PrecisionImage.HistogramProcessing HistogramResolution
A HistogramResolution enumeration specifying the resolution of the internally computed histogram.
regionOfInterest (Optional)
Type: OnlineSystem.Windows Int32Rect
An OnlineInt32Rect type indicating the region of interest. Coordinates are zero-index based. This parameter is optional and defaults to the entire image.
binaryMask (Optional)
Type: PrecisionImage.BinarizationAndMorphology BinaryMask
A BinaryMask object indicating areas to bypass. Default is no mask.

Return Value

A BinaryMask object generated from the input data using the computed threshold value.

OnlineSystem ArgumentNullException Thrown when sourceData is null.
OnlineSystem ArgumentOutOfRangeException Thrown when channel specifies a channel that does not exist.
OnlineSystem ArgumentOutOfRangeException Thrown when regionOfInterest specifies a region not completely contained within the input data.
OnlineSystem ArgumentException Thrown when the dimensions of binaryMask do not match those of sourceData.

This method is used to compute the globally-optimum Otsu threshold value and returns a BinaryMask object that reflects the input data thresholded at that value. Values in the input data that fall below the computed threshold are masked (false), values in the input data that fall above the threshold value are unmasked (true) in the resulting BinaryMask object. The input data is not altered.
See Also