Class DocumentQualityAnalyzerResult
java.lang.Object
io.scanbot.sdk.documentqualityanalyzer.DocumentQualityAnalyzerResult
- All Implemented Interfaces:
AutoCloseable
Result 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
ConstructorsConstructorDescriptionDocumentQualityAnalyzerResult(DocumentQualityAssessment quality, boolean documentFound, DocumentQuality qualityLevel, double orientation, double orientationConfidence, List<Integer> cumulativeQualityHistogram, double bestInputScale) Constructs DocumentQualityAnalyzerResult with default parameters.DocumentQualityAnalyzerResult(DocumentQualityAssessment quality, boolean documentFound, DocumentQuality qualityLevel, double orientation, double orientationConfidence, List<Integer> cumulativeQualityHistogram, ImageRef qualityHeatmap, double bestInputScale) Constructs DocumentQualityAnalyzerResult with the given params. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes native resources (images) held by the object.doubleGetter for bestInputScale field.Getter for cumulativeQualityHistogram field.booleanDeprecated.doubleGetter for orientation field.doubleGetter for orientationConfidence field.Getter for quality field.Getter for qualityHeatmap field.Deprecated.Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.
-
Constructor Details
-
DocumentQualityAnalyzerResult
public DocumentQualityAnalyzerResult(DocumentQualityAssessment quality, boolean documentFound, DocumentQuality qualityLevel, double orientation, double orientationConfidence, List<Integer> cumulativeQualityHistogram, ImageRef qualityHeatmap, double bestInputScale) Constructs DocumentQualityAnalyzerResult with the given params.- Parameters:
quality- Document quality as estimated from the given quality analysis model.documentFound- True if a document was found. Deprecated. Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.qualityLevel- Quality of the document, if found. The exact behavior of this value can be configured with the `qualityThresholds` and `qualityIndices` parameters. Deprecated. Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.orientation- Dominant orientation of the document, if found. 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. 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 ProcessByTileConfiguration 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.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.bestInputScale- Returns the best inputScale whose results are used (see inputScales configuration option).
-
DocumentQualityAnalyzerResult
public DocumentQualityAnalyzerResult(DocumentQualityAssessment quality, boolean documentFound, DocumentQuality qualityLevel, double orientation, double orientationConfidence, List<Integer> cumulativeQualityHistogram, double bestInputScale) Constructs DocumentQualityAnalyzerResult with default parameters.- Parameters:
quality- Document quality as estimated from the given quality analysis model.documentFound- True if a document was found. Deprecated. Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.qualityLevel- Quality of the document, if found. The exact behavior of this value can be configured with the `qualityThresholds` and `qualityIndices` parameters. Deprecated. Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.orientation- Dominant orientation of the document, if found. 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. 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 ProcessByTileConfiguration 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.bestInputScale- Returns the best inputScale whose results are used (see inputScales configuration option).
-
-
Method Details
-
getQuality
Getter for quality field. See constructor documentation for more information about the field.- Returns:
- quality
-
getDocumentFound
public boolean getDocumentFound()Deprecated.Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.Getter for documentFound field. See constructor documentation for more information about the field.- Returns:
- documentFound
-
getQualityLevel
Deprecated.Replaced bygetQuality()or the corresponding constructor argument, because it provides a more reliable result.Getter for qualityLevel field. See constructor documentation for more information about the field.- Returns:
- qualityLevel
-
getOrientation
public double getOrientation()Getter for orientation field. See constructor documentation for more information about the field.- Returns:
- orientation
-
getOrientationConfidence
public double getOrientationConfidence()Getter for orientationConfidence field. See constructor documentation for more information about the field.- Returns:
- orientationConfidence
-
getCumulativeQualityHistogram
Getter for cumulativeQualityHistogram field. See constructor documentation for more information about the field.- Returns:
- cumulativeQualityHistogram
-
getQualityHeatmap
Getter for qualityHeatmap field. See constructor documentation for more information about the field.- Returns:
- qualityHeatmap
-
getBestInputScale
public double getBestInputScale()Getter for bestInputScale field. See constructor documentation for more information about the field.- Returns:
- bestInputScale
-
close
public void close()Closes native resources (images) held by the object.- Specified by:
closein interfaceAutoCloseable
-
getQuality()or the corresponding constructor argument, because it provides a more reliable result.