| MIL 10 Reference
| Customize Help
| Save Settings

MimLabel



See also
Availability
Not available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Label objects in an image buffer.
Syntax
void MimLabel(
MIL_ID SrcImageBufId, //in
MIL_ID DstImageBufId, //in
MIL_INT64 ProcMode //in
)
Description

This function labels all objects (or blobs) in the specified source image, starting from the top-left corner, with unique consecutive values beginning with the value 1. Each pixel in the same blob is given the same numerical value.

If you want to distinguish between touching blobs, you should separate the blobs. For example, you can use an erosion operation before performing the labeling operation.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SrcImageBufId

Specifies identifier of the data source of the operation. This parameter must be given an image buffer identifier. If the source buffer is not binary, all non-zero pixels are considered as part of an object or blob.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

DstImageBufId

Specifies the identifier of the destination of the results. This parameter must be given an image buffer identifier. The destination buffer should be large enough to hold the maximum number of objects (blobs). For example, an 8-bit buffer can be used for a maximum of 254 blobs and a 16-bit buffer can be used for a maximum of 65534 blobs). If the destination buffer depth is too small, several blobs might be given the same value.

This image buffer must not have a region of interest (ROI) associated with it. Using an image buffer with an ROI will cause an error.

ProcMode

Specifies the type of connectivity (lattice) to use for processing. This parameter can be set to one of the following values:

function map For specifying the type of connectivity to use
CollapseValue Description
Collapse M_4_CONNECTED +

Specifies that each pixel has 4 neighbors. If two blobs touch on the vertical and horizontal axis, they are considered one blob.

(summarize)
Collapse M_8_CONNECTED +

Specifies that each pixel has 8 neighbors. If two blobs touch on the vertical, horizontal, or diagonal, they are considered one blob.

(summarize)
Combination constants for any of the possible values of the ProcMode parameter.

You can add one of the following values to the above-mentioned values to specify the processing mode.

function map For the ProcMode parameter
CollapseCombination value Description
Collapse M_BINARY

Specifies the binary processing mode.

If the source image is a binarized image (containing 0 or the maximum value of the buffer, achieved for example with MimBinarize() or MimBinarizeAdaptive()), you can add M_BINARY to the connectivity mode to accelerate processing, particularly if the labeling is done by the Host.

(summarize)
Collapse M_GRAYSCALE

Specifies the grayscale processing mode.

This is the default value.

(summarize)
Compilation information
Header Include mil.h.
Library Use mil.lib; milim.lib.
DLL Requires mil.dll; milim.dll.
PROC NONE PROC NONE 4 CONNECTED 8 CONNECTED BINARY GRAYSCALE