API for analyzing document quality.

Required licence feature(s): ImageProcessing.

Methods

  • Frees up any resources associated with this object. No other methods may be called on this object after destroy has been called.

    Returns Promise<void>

  • Parameters

    • workerBridge: WorkerBridge
    • Optional configuration: {
          detectOrientation?: boolean;
          inspectSmallText?: boolean;
          maxImageSize?: number;
          minEstimatedNumberOfSymbolsForDocument?: number;
          minRequiredOrientationConfidence?: number;
          processByTileConfiguration?: { enabled?: boolean; minProcessedFraction?: number; maxProcessedFraction?: number; minNumberOfRequiredSymbols?: number; tileSize?: number; };
          qualityIndices?: DocumentQuality[];
          qualityThresholds?: ({ readonly symbolQuality?: number; readonly symbolRatio?: number; })[];
          returnQualityHeatmap?: boolean;
      }
      • Optional detectOrientation?: boolean

        Enable orientation detection. Document orientation will be returned in DocumentQualityAnalyzerResult.orientation.

        Default Value

        false;
        
      • Optional inspectSmallText?: boolean

        Inspect small text (typically less than 12 pixels height) when analyzing the document quality. If true, processing will be slower, but when the quality issue with a document is the low resolution of the text, then the issue will be caught.

        Default Value

        false;
        
      • Optional maxImageSize?: number

        Maximum image size in pixels, if image is bigger, it will be resized. Zero or negative value means no limit.

        Default Value

        2000;
        
      • Optional minEstimatedNumberOfSymbolsForDocument?: number

        If estimated number of symbols is less than this value, return that document is not found.

        Default Value

        20;
        
      • Optional minRequiredOrientationConfidence?: number

        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 Value

        0.0;
        
      • Optional processByTileConfiguration?: { enabled?: boolean; minProcessedFraction?: number; maxProcessedFraction?: number; minNumberOfRequiredSymbols?: number; tileSize?: number; }

        Configuration for processing image by tiles.

        Default Value

        new ProcessByTileConfiguration({});
        
      • Optional qualityIndices?: DocumentQuality[]

        quality levels.

        Default Value

        ["VERY_POOR", "POOR", "REASONABLE", "GOOD", "EXCELLENT"];
        
      • Optional qualityThresholds?: ({ readonly symbolQuality?: number; readonly symbolRatio?: number; })[]

        Quality thresholds to separate quality levels.

        Default Value

        [new DocumentQualityThreshold({
        "symbolQuality": 0.5,
        "symbolRatio": 0.5
        }), new DocumentQualityThreshold({
        "symbolQuality": 0.7,
        "symbolRatio": 0.3
        }), new DocumentQualityThreshold({
        "symbolQuality": 0.85,
        "symbolRatio": 0.3
        }), new DocumentQualityThreshold({
        "symbolQuality": 0.9,
        "symbolRatio": 0.1
        })];
      • Optional returnQualityHeatmap?: boolean

        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 Value

        false;
        

    Returns Promise<DocumentQualityAnalyzer>

Generated using TypeDoc