FUNCTION REFERENCE

labelmatrix

Label matrix from connected components.

Label matrix from connected components.

Syntax

L = labelmatrix(CC)

Builds the label matrix of size CC.ImageSize with the pixels of CC.PixelIdxList{k} set to k. L has the smallest unsigned integer class that holds CC.NumObjects (uint8 up to 255 objects, uint16 up to 65535, then uint32).

Example

L = labelmatrix(bwconncomp(logical([1 0 1])))   % uint8([1 0 2])

Differences from MATLAB: 2-D only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.