You are here : matlabImage Processingbwlabel

bwlabel() - Image Processing

L = bwlabel(BW) returns
the label matrix L that contains labels for the
8-connected objects found in BW. The label matrix, L,
is the same size as BW.L = bwlabel(BW,n) returns
a label matrix, where the variable n specifies
the connectivity.[L,num]
= bwlabel(___) also returns num,
the number of connected objects found in BW.example[gpuarrayL,num]
= bwlabel(gpuarrayBW,n) performs
the labeling operation on a GPU. The input image and output image
are gpuArrays. The variable n can
be a numeric array or a gpuArray. This syntax requires
the Parallel Computing Toolbox™.Code Generation support:
Yes. MATLAB® Function Block support: No.


Syntax

L = bwlabel(BW) exampleL = bwlabel(BW,n)[L,num]
= bwlabel(___)[gpuarrayL,num]
= bwlabel(gpuarrayBW,n) example


Example

[r, c] = find(bwlabel(BW)==2)


Output / Return Value


Limitations


Alternatives / See Also


Reference