OpenCvSharp.Cv2.ConnectedComponents C# (CSharp) Method

ConnectedComponents() public static 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.
public static ConnectedComponents ( InputArray image, OutputArray labels, PixelConnectivity connectivity = PixelConnectivity.Connectivity8 ) : int
image InputArray the image to be labeled
labels OutputArray destination labeled image
connectivity PixelConnectivity 8 or 4 for 8-way or 4-way connectivity respectively
return int
        public static int ConnectedComponents(InputArray image, OutputArray labels,
            PixelConnectivity connectivity = PixelConnectivity.Connectivity8)
        {
            return ConnectedComponents(image, labels, connectivity, MatType.CV_32S);
        }

Same methods

Cv2::ConnectedComponents ( InputArray image, OutputArray labels, PixelConnectivity connectivity, MatType ltype ) : int
Cv2::ConnectedComponents ( InputArray image, int &labels, PixelConnectivity connectivity ) : int
Cv2