Document Quality Analyzer Configuration
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.
Constructors
Properties
Compatibility mode for the Document Quality Analyzer. If set, the analyzer will return results that are identical to older versions of the SDK.
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.
If inputScale from inputScales is smaller or equal than the threshold minProcessedFraction and maxProcessedFraction will be ignored, and the entire image will be processed.
Maximum image size in pixels, if image is bigger, it will be resized. If less or equal 0 will be ignored.
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 andqualityLevel will be set to false and empty, respectively.
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.
Configuration for processing image by tiles.
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.
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.
Deprecated, please use qualityAnalysisModel instead. Quality levels.
Deprecated, please use qualityAnalysisModel instead. Quality thresholds to separate quality levels.
Same as qualityAcceptableUncertainThreshold, but for documents that are predicted to be UNACCEPTABLE by the model.
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.