Skip to main content

Using the Document Quality Analyzer to analyze the quality of an image

You can use the Document Quality Analyzer to analyze the quality of an image like this:

createDocumentQualityAnalyzer(config: DocumentQualityAnalyzerConfiguration): Promise<DocumentQualityAnalyzer>

See DocumentQualityAnalyzerConfiguration for a list of available configuration options.

async analyze(imageData: Image): Promise<DocumentQualityAnalyzerResult>

Please refer to the API documentation for details on the result object.

Always release the analyzer object after it is no longer needed.

async release(): Promise<void>

Example usage:

async function onDocumentDetected(e) {
const config = new ScanbotSDK.Config.DocumentQualityAnalyzerConfiguration();
const analyzer = await this.sdk.createDocumentQualityAnalyzer(config);
const result = await analyzer.run(image);
console.log('analysis', result);
await analyzer.destroy();
}

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license