Catalano.Imaging.Tools
Class DocumentSkewChecker
- java.lang.Object
-
- Catalano.Imaging.Tools.DocumentSkewChecker
-
public class DocumentSkewChecker extends java.lang.ObjectSkew angle checker for scanned documents.
-
-
Constructor Summary
Constructors Constructor and Description DocumentSkewChecker()Initializes a new instance of the DocumentSkewChecker class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetLocalPeakRadius()Get local peak radius.doublegetMaxSkewToDetect()Get maximum skew angle to detect.doublegetSkewAngle(FastBitmap fastBitmap)Get skew angle of the provided document image.intgetStepsPerDegree()Get steps per degree.voidsetLocalPeakRadius(int localPeakRadius)Radius for searching local peak value, [1, 10].voidsetMaxSkewToDetect(double maxSkewToDetect)Maximum skew angle to detect, [0, 45] degrees.voidsetStepsPerDegree(int stepsPerDegree)Set steps per degree, [1, 10].
-
-
-
Constructor Detail
-
DocumentSkewChecker
public DocumentSkewChecker()
Initializes a new instance of the DocumentSkewChecker class.
-
-
Method Detail
-
getStepsPerDegree
public int getStepsPerDegree()
Get steps per degree.- Returns:
- Steps per degree.
-
setStepsPerDegree
public void setStepsPerDegree(int stepsPerDegree)
Set steps per degree, [1, 10]. The value defines quality of Hough transform and its ability to detect line slope precisely. Default value is set to 1.- Parameters:
stepsPerDegree- Steps per degree.
-
getMaxSkewToDetect
public double getMaxSkewToDetect()
Get maximum skew angle to detect. Default value is set to 30.- Returns:
- Maximum skew angle to detect.
-
setMaxSkewToDetect
public void setMaxSkewToDetect(double maxSkewToDetect)
Maximum skew angle to detect, [0, 45] degrees. The value sets maximum document's skew angle to detect. Document's skew angle can be as positive (rotated counter clockwise), as negative (rotated clockwise). So setting this value to 25, for example, will lead to [-25, 25] degrees detection range. Scanned documents usually have skew in the [-20, 20] degrees range.- Parameters:
maxSkewToDetect- Maximum skew to detect.
-
getLocalPeakRadius
public int getLocalPeakRadius()
Get local peak radius. Default value is set to 4.- Returns:
- Local peak radius.
-
setLocalPeakRadius
public void setLocalPeakRadius(int localPeakRadius)
Radius for searching local peak value, [1, 10]. The value determines radius around a map's value, which is analyzed to determine if the map's value is a local maximum in specified area.- Parameters:
localPeakRadius- Local peak radius.
-
getSkewAngle
public double getSkewAngle(FastBitmap fastBitmap)
Get skew angle of the provided document image.- Parameters:
fastBitmap- FastBitmap.- Returns:
- Returns document's skew angle. If the returned angle equals to -90, then document skew detection has failed.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG