Catalano.Imaging.Filters
Class HorizontalRunLengthSmoothing
- java.lang.Object
-
- Catalano.Imaging.Filters.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 Summary
Constructors Constructor and Description HorizontalRunLengthSmoothing()Initialize a new instance of the HorizontalRunLengthSmoothing class.HorizontalRunLengthSmoothing(int maxGapSize)Initialize a new instance of the HorizontalRunLengthSmoothing class.HorizontalRunLengthSmoothing(int maxGapSize, boolean processGapsWithImageBorders)Initialize a new instance of the HorizontalRunLengthSmoothing class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidapplyInPlace(FastBitmap fastBitmap)Apply filter to an image.intgetMaxGapSize()Get Maximum gap size to fill (in pixels).booleanisProcessGapsWithImageBorders()Verify Process gaps between objects and image borders or not.voidsetMaxGapSize(int maxGapSize)Set Maximum gap size to fill (in pixels).voidsetProcessGapsWithImageBorders(boolean processGapsWithImageBorders)Set Process gaps between objects and image borders or not.
-
-
-
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:IApplyInPlaceApply filter to an image.- Specified by:
applyInPlacein interfaceIApplyInPlace- Parameters:
fastBitmap- Image to be processed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG