Class DocumentQualityAnalyzerResult
- java.lang.Object
-
- io.scanbot.sdk.documentqualityanalyzer.DocumentQualityAnalyzerResult
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DocumentQualityAnalyzerResult extends java.lang.Object implements java.lang.AutoCloseableResult of document quality analysis. It can be used to determine, e.g., if a document is good enough to be used for OCR processing.
-
-
Constructor Summary
Constructors Constructor Description DocumentQualityAnalyzerResult(boolean documentFound, DocumentQuality quality, java.lang.Double orientation, java.lang.Double orientationConfidence, java.util.List<java.lang.Integer> cumulativeQualityHistogram, java.util.List<java.lang.Integer> cumulativeContrastHistogram, java.util.List<java.lang.Integer> cumulativeTextSizeHistogram)Constructs DocumentQualityAnalyzerResult with default parameters.DocumentQualityAnalyzerResult(boolean documentFound, DocumentQuality quality, java.lang.Double orientation, java.lang.Double orientationConfidence, java.util.List<java.lang.Integer> cumulativeQualityHistogram, java.util.List<java.lang.Integer> cumulativeContrastHistogram, java.util.List<java.lang.Integer> cumulativeTextSizeHistogram, ImageRef qualityHeatmap)Constructs DocumentQualityAnalyzerResult with the given params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes native resources (images) held by the object.java.util.List<java.lang.Integer>getCumulativeContrastHistogram()Getter for cumulativeContrastHistogram field.java.util.List<java.lang.Integer>getCumulativeQualityHistogram()Getter for cumulativeQualityHistogram field.java.util.List<java.lang.Integer>getCumulativeTextSizeHistogram()Getter for cumulativeTextSizeHistogram field.booleangetDocumentFound()Getter for documentFound field.java.lang.DoublegetOrientation()Getter for orientation field.java.lang.DoublegetOrientationConfidence()Getter for orientationConfidence field.DocumentQualitygetQuality()Getter for quality field.ImageRefgetQualityHeatmap()Getter for qualityHeatmap field.
-
-
-
Constructor Detail
-
DocumentQualityAnalyzerResult
public DocumentQualityAnalyzerResult(boolean documentFound, DocumentQuality quality, java.lang.Double orientation, java.lang.Double orientationConfidence, java.util.List<java.lang.Integer> cumulativeQualityHistogram, java.util.List<java.lang.Integer> cumulativeContrastHistogram, java.util.List<java.lang.Integer> cumulativeTextSizeHistogram, ImageRef qualityHeatmap)Constructs DocumentQualityAnalyzerResult with the given params.- Parameters:
documentFound- True if a document was found.quality- Quality of the document, if found.orientation- Dominant orientation of the document, if found and if orientation detection is enabled. The value is in degrees counter-clockwise, where 0 corresponds to the document being straight, and the value is in the range of [-180, 180]. To rotate the document to be straight, rotate the image clockwise by this value.orientationConfidence- Confidence that the reported orientation of the document is correct. Returned if orientation detection is enabled. The value is in the range of [0, 1]. Possible reasons for low confidence are: * Document contains text with multiple orientations. * Text on the document is poorly readable. * Text on the document is on the edge of detectable text range (text is too small or too big). * Insufficient statistics because only part of the image was processed. See minProcessedFraction, maxProcessedFraction, and earlyStopIfNSymbolsFound options in the DocumentQualityAnalyzerConfiguration.cumulativeQualityHistogram- Cumulative histogram where every entry is equal to the number of symbols with quality equal or lower than N percent, where N is the index of the entry in the array.cumulativeContrastHistogram- Cumulative histogram where every entry is equal to the number of symbols with contrast equal or lower than N percent, where N is the index of the entry in the array.cumulativeTextSizeHistogram- Cumulative histogram where every entry is equal to the number of symbols with text size equal or lower than N percent, where N is the index of the entry in the array.qualityHeatmap- Quality heatmap. Black marks areas of no detected text. Colors represent the quality of detected text, with red meaning the lowest quality and yellow and green meaning progressively higher quality.
-
DocumentQualityAnalyzerResult
public DocumentQualityAnalyzerResult(boolean documentFound, DocumentQuality quality, java.lang.Double orientation, java.lang.Double orientationConfidence, java.util.List<java.lang.Integer> cumulativeQualityHistogram, java.util.List<java.lang.Integer> cumulativeContrastHistogram, java.util.List<java.lang.Integer> cumulativeTextSizeHistogram)Constructs DocumentQualityAnalyzerResult with default parameters.- Parameters:
documentFound- True if a document was found.quality- Quality of the document, if found.orientation- Dominant orientation of the document, if found and if orientation detection is enabled. The value is in degrees counter-clockwise, where 0 corresponds to the document being straight, and the value is in the range of [-180, 180]. To rotate the document to be straight, rotate the image clockwise by this value.orientationConfidence- Confidence that the reported orientation of the document is correct. Returned if orientation detection is enabled. The value is in the range of [0, 1]. Possible reasons for low confidence are: * Document contains text with multiple orientations. * Text on the document is poorly readable. * Text on the document is on the edge of detectable text range (text is too small or too big). * Insufficient statistics because only part of the image was processed. See minProcessedFraction, maxProcessedFraction, and earlyStopIfNSymbolsFound options in the DocumentQualityAnalyzerConfiguration.cumulativeQualityHistogram- Cumulative histogram where every entry is equal to the number of symbols with quality equal or lower than N percent, where N is the index of the entry in the array.cumulativeContrastHistogram- Cumulative histogram where every entry is equal to the number of symbols with contrast equal or lower than N percent, where N is the index of the entry in the array.cumulativeTextSizeHistogram- Cumulative histogram where every entry is equal to the number of symbols with text size equal or lower than N percent, where N is the index of the entry in the array.
-
-
Method Detail
-
getDocumentFound
public boolean getDocumentFound()
Getter for documentFound field. See constructor documentation for more information about the field.- Returns:
- documentFound
-
getQuality
public DocumentQuality getQuality()
Getter for quality field. See constructor documentation for more information about the field.- Returns:
- quality
-
getOrientation
public java.lang.Double getOrientation()
Getter for orientation field. See constructor documentation for more information about the field.- Returns:
- orientation
-
getOrientationConfidence
public java.lang.Double getOrientationConfidence()
Getter for orientationConfidence field. See constructor documentation for more information about the field.- Returns:
- orientationConfidence
-
getCumulativeQualityHistogram
public java.util.List<java.lang.Integer> getCumulativeQualityHistogram()
Getter for cumulativeQualityHistogram field. See constructor documentation for more information about the field.- Returns:
- cumulativeQualityHistogram
-
getCumulativeContrastHistogram
public java.util.List<java.lang.Integer> getCumulativeContrastHistogram()
Getter for cumulativeContrastHistogram field. See constructor documentation for more information about the field.- Returns:
- cumulativeContrastHistogram
-
getCumulativeTextSizeHistogram
public java.util.List<java.lang.Integer> getCumulativeTextSizeHistogram()
Getter for cumulativeTextSizeHistogram field. See constructor documentation for more information about the field.- Returns:
- cumulativeTextSizeHistogram
-
getQualityHeatmap
public ImageRef getQualityHeatmap()
Getter for qualityHeatmap field. See constructor documentation for more information about the field.- Returns:
- qualityHeatmap
-
close
public void close()
Closes native resources (images) held by the object.- Specified by:
closein interfacejava.lang.AutoCloseable
-
-