Class DocumentQualityAnalyzerConfiguration


  • public class DocumentQualityAnalyzerConfiguration
    extends java.lang.Object
    Document Quality Analyzer configuration The document quality analysis of a document can be slow on low end devices. To speed up the analysis, only parts of the the document can be analyzed. This can yield faster results but may result in less accurate predictions. The configuration parameters `minProcessedFraction` and `maxProcessedFraction` define a range of the image that will be analyzed. In that range, `minNumberOfRequiredSymbols` and `minRequiredOrientationConfidence` define under which conditions the analysis will stop early.
    • Constructor Detail

      • DocumentQualityAnalyzerConfiguration

        public DocumentQualityAnalyzerConfiguration​(java.lang.String qualityAnalysisModel,
                                                    double qualityAcceptableUncertainThreshold,
                                                    double qualityUnacceptableUncertainThreshold,
                                                    java.util.List<DocumentQualityThreshold> qualityLevelThresholds,
                                                    java.util.List<DocumentQuality> qualityLevelIndices,
                                                    java.util.List<java.lang.Double> inputScales,
                                                    double inputScaleThresholdToProcessEntireImage,
                                                    int maxImageSize,
                                                    int minEstimatedNumberOfSymbolsForDocument,
                                                    ProcessByTileConfiguration processByTileConfiguration,
                                                    double minRequiredOrientationConfidence,
                                                    boolean returnQualityHeatmap,
                                                    DocumentQualityAnalyzerCompatibilityModeConfiguration compatibilityMode)
        Constructs DocumentQualityAnalyzerConfiguration with the given params.
        Parameters:
        qualityAnalysisModel - Document quality analysis model to use. If empty, the built-in model is used which provides reasonable quality estimates for a wide variety of documents. If the built-in model is not a good fit for your use case, consider creating a model based on your own documents and use case. To create a fine-tuned quality analysis model, follow the documentation of our DoQA model configurator tool. You can find it here: https://github.com/doo/scanbot-sdk-doqa-configurator. Default is ""
        qualityAcceptableUncertainThreshold - There are documents for which the quality analysis model is uncertain, meaning that the model is not sure if the document is acceptable or not. E.g., the model may report a document quality to be `ACCEPTABLE` with 60% confidence. Depending on the value of this threshold, the document in this case will be reported as `ACCEPTABLE` or `UNCERTAIN`. The default value of 0.5 will typically lead to a good balance between the number of documents reported as `ACCEPTABLE` and `UNCERTAIN`. A lower value will lead to fewer UNCERTAIN documents, but unacceptable documents will more often be reported as `ACCEPTABLE` (false positives). A higher value will lead to more borderline documents being reported as UNCERTAIN, but unacceptable documents will be reported as `ACCEPTABLE` less often. If 0, no documents with a predicted quality of `ACCEPTABLE` will be reported as `UNCERTAIN`, regardless of the model's confidence, unless the document has very few symbols (see `minEstimatedNumberOfSymbolsForDocument`). If 1, almost all documents with a predicted quality of `ACCEPTABLE` will be reported as `UNCERTAIN`. Must be in the range of [0, 1]. Default is 0.5
        qualityUnacceptableUncertainThreshold - Same as `qualityAcceptableUncertainThreshold`, but for documents that are predicted to be `UNACCEPTABLE` by the model. Default is 0.5
        qualityLevelThresholds - Deprecated, please use `qualityAnalysisModel` instead. Quality thresholds to separate quality levels.
        qualityLevelIndices - Deprecated, please use `qualityAnalysisModel` instead. Quality levels.
        inputScales - Runs the Document Quality Analyzer on the listed inputScales. Only the best result will be returned. Typical range of the text height, which model can work with, is 5-40 pixels. 10 pixels height is recommended. Use this option if documents with smaller or bigger texts are expected. For example, if 80 pixels text height is expected, scale should be 1/8. Not compatible with maxImageSize. If not [1] maxImageSize should be less or equal 0.
        inputScaleThresholdToProcessEntireImage - If inputScale from inputScales is smaller or equal than the threshold minProcessedFraction and maxProcessedFraction will be ignored, and the entire image will be processed. Default is 0.25
        maxImageSize - Maximum image size in pixels, if image is bigger, it will be resized. If less or equal 0 will be ignored. Default is 2000
        minEstimatedNumberOfSymbolsForDocument - If a document's estimated number of symbols is less than this value, document quality will be reported as `UNCERTAIN`. In that case, the deprecated result fields `documentFound` and`qualityLevel` will be set to false and empty, respectively. Default is 20
        processByTileConfiguration - Configuration for processing image by tiles.
        minRequiredOrientationConfidence - If detectOrientation is True, minNumberOfRequiredSymbols is found, and orientationConfidence is bigger than this threshold, the processing stops. If the maxProcessedFraction part of the image is processed and orientationConfidence is lower than the threshold, the returned orientation will be 0. Default is 0.9
        returnQualityHeatmap - If true, will return the quality heatmap as a part of the result. In this case, the entire image will be processed and the minProcessedFraction will be ignored. Useful for debugging situations where the returned quality doesn't appear to match the perceived quality. Default is false
        compatibilityMode - Compatibility mode for the Document Quality Analyzer. If set, the analyzer will return results that are identical to older versions of the SDK.
      • DocumentQualityAnalyzerConfiguration

        public DocumentQualityAnalyzerConfiguration()
        Constructs DocumentQualityAnalyzerConfiguration with default parameters.
    • Method Detail

      • getQualityAnalysisModel

        public java.lang.String getQualityAnalysisModel()
        Getter for qualityAnalysisModel field. See constructor documentation for more information about the field.
        Returns:
        qualityAnalysisModel
      • setQualityAnalysisModel

        public void setQualityAnalysisModel​(java.lang.String qualityAnalysisModel)
        Setter for qualityAnalysisModel field. See constructor documentation for more information about the field.
        Parameters:
        qualityAnalysisModel - Value to set.
      • getQualityAcceptableUncertainThreshold

        public double getQualityAcceptableUncertainThreshold()
        Getter for qualityAcceptableUncertainThreshold field. See constructor documentation for more information about the field.
        Returns:
        qualityAcceptableUncertainThreshold
      • setQualityAcceptableUncertainThreshold

        public void setQualityAcceptableUncertainThreshold​(double qualityAcceptableUncertainThreshold)
        Setter for qualityAcceptableUncertainThreshold field. See constructor documentation for more information about the field.
        Parameters:
        qualityAcceptableUncertainThreshold - Value to set.
      • getQualityUnacceptableUncertainThreshold

        public double getQualityUnacceptableUncertainThreshold()
        Getter for qualityUnacceptableUncertainThreshold field. See constructor documentation for more information about the field.
        Returns:
        qualityUnacceptableUncertainThreshold
      • setQualityUnacceptableUncertainThreshold

        public void setQualityUnacceptableUncertainThreshold​(double qualityUnacceptableUncertainThreshold)
        Setter for qualityUnacceptableUncertainThreshold field. See constructor documentation for more information about the field.
        Parameters:
        qualityUnacceptableUncertainThreshold - Value to set.
      • getQualityLevelThresholds

        public java.util.List<DocumentQualityThreshold> getQualityLevelThresholds()
        Getter for qualityLevelThresholds field. See constructor documentation for more information about the field.
        Returns:
        qualityLevelThresholds
      • setQualityLevelThresholds

        public void setQualityLevelThresholds​(java.util.List<DocumentQualityThreshold> qualityLevelThresholds)
        Setter for qualityLevelThresholds field. See constructor documentation for more information about the field.
        Parameters:
        qualityLevelThresholds - Value to set.
      • getQualityLevelIndices

        public java.util.List<DocumentQuality> getQualityLevelIndices()
        Getter for qualityLevelIndices field. See constructor documentation for more information about the field.
        Returns:
        qualityLevelIndices
      • setQualityLevelIndices

        public void setQualityLevelIndices​(java.util.List<DocumentQuality> qualityLevelIndices)
        Setter for qualityLevelIndices field. See constructor documentation for more information about the field.
        Parameters:
        qualityLevelIndices - Value to set.
      • getInputScales

        public java.util.List<java.lang.Double> getInputScales()
        Getter for inputScales field. See constructor documentation for more information about the field.
        Returns:
        inputScales
      • setInputScales

        public void setInputScales​(java.util.List<java.lang.Double> inputScales)
        Setter for inputScales field. See constructor documentation for more information about the field.
        Parameters:
        inputScales - Value to set.
      • getInputScaleThresholdToProcessEntireImage

        public double getInputScaleThresholdToProcessEntireImage()
        Getter for inputScaleThresholdToProcessEntireImage field. See constructor documentation for more information about the field.
        Returns:
        inputScaleThresholdToProcessEntireImage
      • setInputScaleThresholdToProcessEntireImage

        public void setInputScaleThresholdToProcessEntireImage​(double inputScaleThresholdToProcessEntireImage)
        Setter for inputScaleThresholdToProcessEntireImage field. See constructor documentation for more information about the field.
        Parameters:
        inputScaleThresholdToProcessEntireImage - Value to set.
      • getMaxImageSize

        public int getMaxImageSize()
        Getter for maxImageSize field. See constructor documentation for more information about the field.
        Returns:
        maxImageSize
      • setMaxImageSize

        public void setMaxImageSize​(int maxImageSize)
        Setter for maxImageSize field. See constructor documentation for more information about the field.
        Parameters:
        maxImageSize - Value to set.
      • getMinEstimatedNumberOfSymbolsForDocument

        public int getMinEstimatedNumberOfSymbolsForDocument()
        Getter for minEstimatedNumberOfSymbolsForDocument field. See constructor documentation for more information about the field.
        Returns:
        minEstimatedNumberOfSymbolsForDocument
      • setMinEstimatedNumberOfSymbolsForDocument

        public void setMinEstimatedNumberOfSymbolsForDocument​(int minEstimatedNumberOfSymbolsForDocument)
        Setter for minEstimatedNumberOfSymbolsForDocument field. See constructor documentation for more information about the field.
        Parameters:
        minEstimatedNumberOfSymbolsForDocument - Value to set.
      • getProcessByTileConfiguration

        public ProcessByTileConfiguration getProcessByTileConfiguration()
        Getter for processByTileConfiguration field. See constructor documentation for more information about the field.
        Returns:
        processByTileConfiguration
      • setProcessByTileConfiguration

        public void setProcessByTileConfiguration​(ProcessByTileConfiguration processByTileConfiguration)
        Setter for processByTileConfiguration field. See constructor documentation for more information about the field.
        Parameters:
        processByTileConfiguration - Value to set.
      • getMinRequiredOrientationConfidence

        public double getMinRequiredOrientationConfidence()
        Getter for minRequiredOrientationConfidence field. See constructor documentation for more information about the field.
        Returns:
        minRequiredOrientationConfidence
      • setMinRequiredOrientationConfidence

        public void setMinRequiredOrientationConfidence​(double minRequiredOrientationConfidence)
        Setter for minRequiredOrientationConfidence field. See constructor documentation for more information about the field.
        Parameters:
        minRequiredOrientationConfidence - Value to set.
      • getReturnQualityHeatmap

        public boolean getReturnQualityHeatmap()
        Getter for returnQualityHeatmap field. See constructor documentation for more information about the field.
        Returns:
        returnQualityHeatmap
      • setReturnQualityHeatmap

        public void setReturnQualityHeatmap​(boolean returnQualityHeatmap)
        Setter for returnQualityHeatmap field. See constructor documentation for more information about the field.
        Parameters:
        returnQualityHeatmap - Value to set.
      • setCompatibilityMode

        public void setCompatibilityMode​(DocumentQualityAnalyzerCompatibilityModeConfiguration compatibilityMode)
        Setter for compatibilityMode field. See constructor documentation for more information about the field.
        Parameters:
        compatibilityMode - Value to set.