UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

144 lines (134 loc) 5.16 kB
import { ImageRef } from '../imageRef/image'; import { ToJsonConfiguration } from '../utils/json/JsonSerializationTypes'; import { DeepPartial, PartiallyConstructible } from '../utils/utils'; /** Result of document quality analysis. - `VERY_POOR`: Very poor quality. - `POOR`: Poor quality. - `REASONABLE`: Reasonable quality. - `GOOD`: Good quality. - `EXCELLENT`: Excellent quality. */ export type DocumentQuality = 'VERY_POOR' | 'POOR' | 'REASONABLE' | 'GOOD' | 'EXCELLENT'; export declare const DocumentQualityValues: DocumentQuality[]; /** Point in the quality-number of symbols space to separate quality levels. */ export declare class DocumentQualityThreshold extends PartiallyConstructible { /** Symbol quality. */ readonly symbolQuality: number; /** Symbol ratio. */ readonly symbolRatio: number; /** @param source {@displayType `DeepPartial<DocumentQualityThreshold>`} */ constructor(source?: DeepPartial<DocumentQualityThreshold>); } /** Document Quality Analyzer configuration. */ export declare class DocumentQualityAnalyzerConfiguration extends PartiallyConstructible { /** Quality thresholds to separate quality levels. */ qualityThresholds: DocumentQualityThreshold[]; /** quality levels. */ qualityIndices: DocumentQuality[]; /** Enable orientation detection. Document orientation will be returned in `DocumentQualityAnalyzerResult.orientation`. Default is false */ detectOrientation: 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 is false */ inspectSmallText: boolean; /** Maximum image size in pixels, if image is bigger, it will be resized. Default is 2000 */ maxImageSize: number; /** If estimated number of symbols is less than this value, return that document is not found. Default is 20 */ minEstimatedNumberOfSymbolsForDocument: number; /** At least this fraction of the image will be processed, range is from 0 to 1. Default is 0 */ minProcessedFraction: number; /** At most this fraction of the image will be processed, range is from 0 to 1. Default is 0.5 */ maxProcessedFraction: number; /** If this number of symbols is found and minProcessedFraction of the image is processed, the processing stops. Default is 100 */ earlyStopIfNSymbolsFound: number; /** Image will be processed in tiles of this size; will be ignored if image is small. Default is 300 */ tileSize: number; /** 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 is false */ returnQualityHeatmap: boolean; /** @param source {@displayType `DeepPartial<DocumentQualityAnalyzerConfiguration>`} */ constructor(source?: DeepPartial<DocumentQualityAnalyzerConfiguration>); } /** Result of document quality analysis. It can be used to determine, e.g., if a document is good enough to be used for OCR processing. */ export declare class DocumentQualityAnalyzerResult extends PartiallyConstructible { /** True if a document was found. */ readonly documentFound: boolean; /** Quality of the document, if found. */ readonly quality: DocumentQuality | null; /** Dominant orientation of the document, if found and if orientation detection is enabled. The value is in degrees counter-clockwise, where 0 corresponds to the document being straight, and the value is in the range of [-180, 180]. To rotate the document to be straight, rotate the image clockwise by this value. */ readonly orientation: number | null; /** Cumulative histogram where every entry is equal to the number of symbols with quality equal or lower than N percent, where N is the index of the entry in the array. */ readonly cumulativeQualityHistogram: number[]; /** Quality heatmap. Black marks areas of no detected text. Colors represent the quality of detected text, with red meaning the lowest quality and yellow and green meaning progressively higher quality. */ readonly qualityHeatmap: ImageRef | null; /** @param source {@displayType `DeepPartial<DocumentQualityAnalyzerResult>`} */ constructor(source?: DeepPartial<DocumentQualityAnalyzerResult>); serialize(config?: ToJsonConfiguration): Promise<DeepPartial<DocumentQualityAnalyzerResult>>; private _released; release(): void; encodeImages(): Promise<void>; } //# sourceMappingURL=DocumentQualityAnalyzerTypes.d.ts.map