Core Optical, Inc.
BinaryMask Constructor (BitmapSource, Int32, Int32, Boolean)Industrial Strength, Scientific Grade
Instantiates a BinaryMask object based on the specified OnlineBitmapSource and a pair of pixel thresholds.

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

public BinaryMask(
	BitmapSource bitmapSource,
	int lowThreshold,
	int highThreshold,
	bool maskOutOfRangeValues
)

Parameters

bitmapSource
Type: OnlineSystem.Windows.Media.Imaging BitmapSource
A OnlineBitmapSource object of type OnlineGray8 or OnlineGray16 upon which the BinaryMask is to be based.
lowThreshold
Type: OnlineSystem Int32
An OnlineInt32 type indicating the threshold pixel value delimiting the lower limit of the masked/unmasked region. The threshold value is inclusive in the mask-building logic and is always unmasked (true).
highThreshold
Type: OnlineSystem Int32
An OnlineInt32 type indicating the threshold pixel value delimiting the upper limit of the masked/unmasked region. The threshold value is inclusive in the mask-building logic and is always unmasked (true).
maskOutOfRangeValues
Type: OnlineSystem Boolean
A OnlineBoolean type indicating whether or not the range of values contained within the lower and upper thresholds is masked (maskOutOfRangeValues = false) or unmasked (maskOutOfRangeValues = true).
Exceptions

ExceptionCondition
OnlineSystem ArgumentNullException Thrown when bitmapSource is null.
OnlineSystem ArgumentOutOfRangeException Thrown when bitmapSource is not an 8-bit or 16-bit grayscale image.
OnlineSystem ArgumentException Thrown when lowThreshold is greater or equal to highThreshold.
OnlineSystem ArgumentOutOfRangeException Thrown when lowThreshold or highThreshold fall outside the possible range of values.
See Also