Documentation of 'Catalano.Imaging.Filters.HorizontalRunLengthSmoothing' Java class
HorizontalRunLengthSmoothing
Catalano.Imaging.Filters

Class HorizontalRunLengthSmoothing

  • All Implemented Interfaces:
    IApplyInPlace


    public class HorizontalRunLengthSmoothing
    extends java.lang.Object
    implements IApplyInPlace
    Horizontal run length smoothing algorithm. 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.
    • Constructor Detail

      • HorizontalRunLengthSmoothing

        public HorizontalRunLengthSmoothing()
        Initialize a new instance of the HorizontalRunLengthSmoothing class.
      • HorizontalRunLengthSmoothing

        public HorizontalRunLengthSmoothing(int maxGapSize)
        Initialize a new instance of the HorizontalRunLengthSmoothing class.
        Parameters:
        maxGapSize - Maximum gap size to fill.
      • HorizontalRunLengthSmoothing

        public HorizontalRunLengthSmoothing(int maxGapSize,
                                            boolean processGapsWithImageBorders)
        Initialize a new instance of the HorizontalRunLengthSmoothing class.
        Parameters:
        maxGapSize - Maximum gap size to fill.
        processGapsWithImageBorders - Process gaps between objects and image borders or not.
    • Method Detail

      • getMaxGapSize

        public int getMaxGapSize()
        Get Maximum gap size to fill (in pixels). The property specifies maximum horizontal gap between white pixels to fill. If number of black pixels between some white pixels is bigger than this value, then those black pixels are left as is; otherwise the gap is filled with white pixels.
        Returns:
        Gap size.
      • setMaxGapSize

        public void setMaxGapSize(int maxGapSize)
        Set Maximum gap size to fill (in pixels). The property specifies maximum horizontal gap between white pixels to fill. If number of black pixels between some white pixels is bigger than this value, then those black pixels are left as is; otherwise the gap is filled with white pixels.
        Parameters:
        maxGapSize - Gap size.
      • isProcessGapsWithImageBorders

        public boolean isProcessGapsWithImageBorders()
        Verify Process gaps between objects and image borders or not. The property sets if gaps between image borders and objects must be treated as gaps between objects and also filled.
        Returns:
        True if process
      • setProcessGapsWithImageBorders

        public void setProcessGapsWithImageBorders(boolean processGapsWithImageBorders)
        Set Process gaps between objects and image borders or not. The property sets if gaps between image borders and objects must be treated as gaps between objects and also filled.
        Parameters:
        processGapsWithImageBorders - True of false.
      • applyInPlace

        public void applyInPlace(FastBitmap fastBitmap)
        Description copied from interface: IApplyInPlace
        Apply filter to an image.
        Specified by:
        applyInPlace in interface IApplyInPlace
        Parameters:
        fastBitmap - Image to be processed.

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.