Description

A bitmask allowing only a subset of all channels to be used for the thresholding during the Execute operation.

Property type

A Long value.  

Syntax

object.ChannelMask [= value]

The ChannelMask Property syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McThreshold.
valueA Long value.

Remarks

By default, when ChannelMask is -1, all channels of a multichannel Interpretation are used to determine if a pixel is foreground or not. Otherwise, each bit of the ChannelMask, starting with the low order bit masks a corresponding color channel (e.g., for an RGB interpretation, bit 0 is the Red channel, bit 1 the Blue and bit 2 the Green). The ChannelMask is applied to the image channels during the Execute operation after any Interpretation property cast is made.

Where a bit of the ChannelMask is zero, then any pixel value for that channel is accepted as foreground. You may use this to, for example, threshold on only Hue while accepting any Saturation or Luminance (see example).

Notes

This property is ignored for any monochrome image or if the Interpretation property is mctiMonochrome.