| Customize Help
| Save Settings

MimLabel



Function Map
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 which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
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
Click to summarizeValue Description
Click to summarize 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)
Click to summarize 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 values 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
Click to summarizeCombination value Description
Click to summarize 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)
Click to summarize 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