MATLAB File Help: cv.connectedComponents | Index |
Computes the connected components labeled image of boolean image
[labels,N] = cv.connectedComponents(image)
[labels,N,stats,centroids] = cv.connectedComponents(image)
[...] = cv.connectedComponents(..., 'OptionName', optionValue, ...)
image
and
specified type in LType
. Labels are in the range [0, N-1]
where
0 represents the background label.int32
matrix. Statistics are accessed via stats(label, col)
where:col=1
: The leftmost (x) coordinate which is the inclusive start of
the bounding box in the horizontal direction.col=2
: The topmost (y) coordinate which is the inclusive start of
the bounding box in the vertical direction.col=3
: The horizontal size of the bounding box (width).col=4
: The vertical size of the bounding box (height).col=5
: The total area (in pixels) of the connected component.(x,y)
output for
each label, including the background label. A Nx2 numeric matrix.
Centroids are accessed via centroids(label,:)
for x and y.int32
and uint16
are
supported. default int32
The last two optional output arguments are only computed if requested.