Fill holes in objects in binary image.Namespace: AForge.Imaging.Filters
Assembly: AForge.Imaging (in AForge.Imaging.dll) Version: 220.127.116.11 (18.104.22.168)
public class FillHoles : BaseInPlaceFilter
The filter accepts binary image only, which are represented as 8 bpp images.
// create and configure the filter FillHoles filter = new FillHoles( ); filter.MaxHoleHeight = 20; filter.MaxHoleWidth = 20; filter.CoupledSizeFiltering = false; // apply the filter Bitmap result = filter.Apply( image );