Horizontal run length smoothing algorithm.
Namespace:
AForge.Imaging.FiltersAssembly: AForge.Imaging (in AForge.Imaging.dll) Version: 2.2.5.0 (2.2.5.0)
Syntax
C# |
---|
public class HorizontalRunLengthSmoothing : BaseInPlacePartialFilter |
Remarks
The class implements horizontal run length smoothing algorithm, which is described in: K.Y. Wong, R.G. Casey and F.M. Wahl, "Document analysis system," IBM J. Res. Devel., Vol. 26, NO. 6,111). 647-656, 1982.
Unlike the original description of this algorithm, this implementation must be applied to inverted binary images containing document, i.e. white text on black background. So this implementation fills horizontal black gaps between white pixels.

The filter accepts 8 bpp grayscale images, which are supposed to be binary inverted documents.
Sample usage:

// create filter HorizontalRunLengthSmoothing hrls = new HorizontalRunLengthSmoothing( 32 ); // apply the filter hrls.ApplyInPlace( image );
Source image:

Result image:

Inheritance Hierarchy
System..::.Object
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.HorizontalRunLengthSmoothing
AForge.Imaging.Filters..::.BaseInPlacePartialFilter
AForge.Imaging.Filters..::.HorizontalRunLengthSmoothing