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

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

public BinaryMask(
	BitmapSource bitmapSource,
	int threshold,
	bool maskLowerValues


Type: OnlineSystem.Windows.Media.Imaging BitmapSource
A OnlineBitmapSource object of type OnlineGray8 or OnlineGray16 upon which the BinaryMask is to be based.
Type: OnlineSystem Int32
An OnlineInt32 type indicating the threshold pixel value delimiting the masked from unmasked regions. The threshold value is inclusive in the mask-building logic and is always unmasked (true).
Type: OnlineSystem Boolean
A OnlineBoolean type indicating whether or not values lower than threshold are masked (maskLowerValues = true) or unmasked (maskLowerValues = false).


Use this constructor to generate a BinaryMask based on the spatial distribution of pixels with a specified threshold value. The bitmapSource image must be either an 8-bit or 16-bit grayscale image. The threshold value is in the native image value range (0 - 255 for 8-bit, 0 - 65535 for 16-bit). Pixels above or below the specified threshold can be either masked (false) or unmasked (true) depending on the maskLowerValues parameter.
See Also