DocumentQualityAnalyzerConfiguration class
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
-
DocumentQualityAnalyzerConfiguration({String qualityAnalysisModel = "", double qualityAcceptableUncertainThreshold = 0.5, double qualityUnacceptableUncertainThreshold = 0.5, List<
DocumentQualityThreshold> ? qualityLevelThresholds, List<DocumentQuality> ? qualityLevelIndices, List<double> ? inputScales, double inputScaleThresholdToProcessEntireImage = 0.25, int maxImageSize = 2000, int minEstimatedNumberOfSymbolsForDocument = 20, ProcessByTileConfiguration? processByTileConfiguration, double minRequiredOrientationConfidence = 0.9, bool returnQualityHeatmap = false, DocumentQualityAnalyzerCompatibilityModeConfiguration? compatibilityMode}) -
DocumentQualityAnalyzerConfiguration.fromJson(Map<
String, dynamic> json) -
factory
Properties
- compatibilityMode ↔ DocumentQualityAnalyzerCompatibilityModeConfiguration?
-
Compatibility mode for the Document Quality Analyzer.
If set, the analyzer will return results that are identical to older versions of the SDK.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inputScales
↔ List<
double> -
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.getter/setter pair - inputScaleThresholdToProcessEntireImage ↔ double
-
If inputScale from inputScales is smaller or equal than the threshold minProcessedFraction and maxProcessedFraction will be ignored, and the entire image will be processed.
getter/setter pair
- maxImageSize ↔ int
-
Maximum image size in pixels, if image is bigger, it will be resized. If less or equal 0 will be ignored.
getter/setter pair
- minEstimatedNumberOfSymbolsForDocument ↔ int
-
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 fieldsdocumentFoundandqualityLevelwill be set to false and empty, respectively.getter/setter pair - minRequiredOrientationConfidence ↔ double
-
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.
getter/setter pair
- processByTileConfiguration ↔ ProcessByTileConfiguration
-
Configuration for processing image by tiles.
getter/setter pair
- qualityAcceptableUncertainThreshold ↔ double
-
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
ACCEPTABLEwith 60% confidence. Depending on the value of this threshold, the document in this case will be reported asACCEPTABLEorUNCERTAIN. The default value of 0.5 will typically lead to a good balance between the number of documents reported asACCEPTABLEandUNCERTAIN. A lower value will lead to fewer UNCERTAIN documents, but unacceptable documents will more often be reported asACCEPTABLE(false positives). A higher value will lead to more borderline documents being reported as UNCERTAIN, but unacceptable documents will be reported asACCEPTABLEless often. If 0, no documents with a predicted quality ofACCEPTABLEwill be reported asUNCERTAIN, regardless of the model's confidence, unless the document has very few symbols (seeminEstimatedNumberOfSymbolsForDocument). If 1, almost all documents with a predicted quality ofACCEPTABLEwill be reported asUNCERTAIN. Must be in the range of[0, 1].getter/setter pair - qualityAnalysisModel ↔ String
-
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.
getter/setter pair
-
qualityLevelIndices
↔ List<
DocumentQuality> -
Deprecated, please use
qualityAnalysisModelinstead. Quality levels.getter/setter pair -
qualityLevelThresholds
↔ List<
DocumentQualityThreshold> -
Deprecated, please use
qualityAnalysisModelinstead. Quality thresholds to separate quality levels.getter/setter pair - qualityUnacceptableUncertainThreshold ↔ double
-
Same as
qualityAcceptableUncertainThreshold, but for documents that are predicted to beUNACCEPTABLEby the model.getter/setter pair - returnQualityHeatmap ↔ bool
-
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.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{ToJsonConfiguration? config}) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited