| Cv2ConnectedComponentsWithAlgorithm Method |
Computes the connected components labeled image of boolean image.
image with 4 or 8 way connectivity - returns N, the total number of labels[0, N - 1] where 0
represents the background label.ltype specifies the output label image type, an important
consideration based on the total number of labels or alternatively the total number of pixels in
the source image.ccltype specifies the connected components labeling algorithm to use, currently
Grana (BBDT) and Wu's (SAUF) algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes
for details.Note that SAUF algorithm forces a row major ordering of labels while BBDT does not.
This function uses parallel version of both Grana and Wu's algorithms if at least one allowed
parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static int ConnectedComponentsWithAlgorithm(
InputArray image,
OutputArray labels,
PixelConnectivity connectivity,
MatType ltype,
ConnectedComponentsAlgorithmsTypes ccltype
)
Public Shared Function ConnectedComponentsWithAlgorithm (
image As InputArray,
labels As OutputArray,
connectivity As PixelConnectivity,
ltype As MatType,
ccltype As ConnectedComponentsAlgorithmsTypes
) As Integer
public:
static int ConnectedComponentsWithAlgorithm(
InputArray^ image,
OutputArray^ labels,
PixelConnectivity connectivity,
MatType ltype,
ConnectedComponentsAlgorithmsTypes ccltype
)
static member ConnectedComponentsWithAlgorithm :
image : InputArray *
labels : OutputArray *
connectivity : PixelConnectivity *
ltype : MatType *
ccltype : ConnectedComponentsAlgorithmsTypes -> int
Parameters
- image
- Type: OpenCvSharpInputArray
the 8-bit single-channel image to be labeled - labels
- Type: OpenCvSharpOutputArray
destination labeled image - connectivity
- Type: OpenCvSharpPixelConnectivity
8 or 4 for 8-way or 4-way connectivity respectively - ltype
- Type: OpenCvSharpMatType
output image label type. Currently CV_32S and CV_16U are supported. - ccltype
- Type: OpenCvSharpConnectedComponentsAlgorithmsTypes
connected components algorithm type.
Return Value
Type:
Int32[Missing <returns> documentation for "M:OpenCvSharp.Cv2.ConnectedComponentsWithAlgorithm(OpenCvSharp.InputArray,OpenCvSharp.OutputArray,OpenCvSharp.PixelConnectivity,OpenCvSharp.MatType,OpenCvSharp.ConnectedComponentsAlgorithmsTypes)"]
See Also