Description

Exposes a labeled bit mask.

Object Model


Remarks

This class is designed to allow efficient access to a representation of a rectangular section foreground and background pixels (a bit mask, where foreground bits are one and background bits are zero). The primary representation is as a labeled scan list. A “scan list” is a list of start,end segments of foreground pixels along a scan line (a horizontal line). A “labeled” bit mask is one where sets of connected forground bits (also known as “blobs”) are counted and tagged with an identifying number (the label). Blobs may be either 4-connected or 8-connected, as identified by the Connect8 property.

In addition to the scan list representation, an unlabeled, packed bitmap is available as the BitmapBits property. To get a labeled bitmap, one could call CreateMaskImage to create an 8-bit or 16-bit monochrome McImage where each pixel holds either zero (for background bits) or a blob label (foreground bits).

Objects of this class are directly creatable via McEngine.CreateOperator, though often they are created by other objects, primarily via McFeatures.CreateFeatureMask, where the McFeatures is usually an McRegions (in some circumstances an McBitMask from an McPoints or an McLines is of interest).

A copy of an McBitMask object may be generated with the Duplicate method. The McBitMask class also exposes a CopyFrom method that allows assignment from a source McBitMask object.

McBitMask has a Threshold property that can be used to fill the mask with foreground bits based on luminance thresholds from a parent or ancestor McImage.

Members

Methods
CopyFrom

Sets the bit mask from a source bit mask.

CreateMaskImage

A mask or labeled McImage is created.

Duplicate

Creates a new McBitMask that is a duplicate of this one.

GetLineIndexAndCount

Quickly gets the number of segments and tags on a given line and returns the index in the AllSegments and AllBlobTags arrays where the line starts.

SetFromBitmapBits

Sets the scan list from packed bit map supplied as a 2-dimensional array of Bytes.

SetFromSegments

The bit mask is set from a supplied array of horizontal foreground segments.


Properties
AllBlobTagsRead-only property

An array holding all label tags corresponding to foreground segments of the bit mask.

AllSegmentsRead-only property

An array holding all foreground segments of the bit mask.

BitmapBitsRead-only property

A 2-dimensional array of packed bits representing a monochrome bitmap of the forground bits in the bit mask.

BlobCountRead-only property

Count of the number of connected foreground “blobs”.

BoundsRectRead-write property

Bounding rectangle of the bit mask

Connect8Read-write property

True if the bit mask is counted and labeled using an 8-connected instead of a 4-connected test.

HeightRead-only property

Height of the bit mask.

HolesBelongToRead-only property

An array giving the blob tag of the surrounding blob for each hole in the bit .

HolesBitMaskRead-only property

If there are any holes in the bit mask, then an McBitMask with foreground bits masking those holes

MaxSegmentsOnAnyLineRead-only property

The maximum number of segments on any line.

SegmentCountsByLineRead-only property

Segment counts for all lines as an array.

ThresholdRead-only property

A local threshold operator for setting an McBitMask

TypeRead-only property

Type of bit mask.

WidthRead-only property

Width of the bit mask.