Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 188.8.131.52 (184.108.40.206)
public class ConnectedComponentsLabeling : BaseFilter
The filter performs labeling of objects in the source image. It colors each separate object using different color. The image processing filter treats all none black pixels as objects' pixels and all black pixel as background.
The filter accepts 8 bpp grayscale images and 24/32 bpp color images and produces 24 bpp RGB image.
// create filter ConnectedComponentsLabeling filter = new ConnectedComponentsLabeling( ); // apply the filter Bitmap newImage = filter.Apply( image ); // check objects count int objectCount = filter.ObjectCount;