L = bwlabel(BW)
L = bwlabel(BW, conn)
[L, num] = bwlabel(...)
| Parameter | Description |
|---|---|
| BW | Input binary image. Nonzero values are treated as true. |
| conn | Connectivity passed to bwconncomp. |
| Parameter | Description |
|---|---|
| L | Label matrix with one positive label per connected component. |
| num | Number of connected components. |
Label connected components in a binary image.
BW=false(64,64); BW(8:20,8:20)=true; BW(36:52,32:48)=true;
L=bwlabel(BW);
figure; imagesc(L); title('Labels');
| Version | Description |
|---|---|
| 2.0.0 | initial version |