/// <summary> /// Lable Connected Components of the scan, Identify unique objects /// </summary> /// <param name="image">The mask</param> /// <returns>A color coded bitmap showing each object in its own color</returns> public static int LabelConnectedComponents(ref Bitmap image) { AForge.Imaging.Filters.ConnectedComponentsLabeling filter = new AForge.Imaging.Filters.ConnectedComponentsLabeling(); //and apply! image = filter.Apply(image); //return object count return(filter.ObjectCount); }
/// <summary> /// Lable Connected Components of the scan, Identify unique objects /// </summary> /// <param name="image">The mask</param> /// <returns>A color coded bitmap showing each object in its own color</returns> public static int LabelConnectedComponents(ref Bitmap image) { AForge.Imaging.Filters.ConnectedComponentsLabeling filter = new AForge.Imaging.Filters.ConnectedComponentsLabeling(); //and apply! image = filter.Apply(image); //return object count return filter.ObjectCount; }