Document Quality Analyzer
The Scanbot SDK Document Quality Analyzer API allows you to determine the quality of text in an image.
The result is a string type where EXCELLENT
is the best text quality in an image and VERY_POOR
is the worst text quality in an image.
It is used to determine if the document is good enough to be used for OCR processing.
createDocumentQualityAnalyzer(config?: DocumentQualityAnalyzerConfiguration): Promise<DocumentQualityAnalyzer>
See DocumentQualityAnalyzerConfiguration for a list of available configuration options.
async analyze(imageData: Image): Promise<DocumentQualityAnalyzerResult>
See the API reference 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 analyzer = await scanbotSDK.createDocumentQualityAnalyzer({ maxImageSize: 2000 });
const result = await analyzer.analyze(e.cropped);
console.log('analysis', result);
await analyzer.release();
}
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial License