Class DocumentScannerParameters

Parameters for the document scanner.

Hierarchy

Constructors

Properties

acceptedAngleScore: number

The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Set lower values to accept more perspective distortion.

Warning: Lower values result in more blurred document images.

Default Value

75.0;
acceptedAspectRatioScore: number

The minimum score in percent (0 - 100) that the aspect ratio of the document must match one of the required aspect ratios (if any) to accept a detected document. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios (if any), otherwise OK_BUT_BAD_ASPECT_RATIO is returned.

Default Value

85.0;
acceptedBrightnessThreshold: number

The minimum brightness value (0-255) to accept a detected document.

Default Value

0;
acceptedSizeScore: number

The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score.

Warning: Lower values result in low resolution document images.

Default Value

80.0;
aspectRatios: AspectRatio[]

The possible desired aspect ratios for the detected document. A document matches if its aspect ratio matches any of the given aspect ratios. If acceptedAspectRatioScore is more than 0, then the document is only accepted if the aspect ratio matches one of the given aspect ratios, otherwise OK_BUT_BAD_ASPECT_RATIO is returned. If empty, no aspect ratio is preferred.

Default Value

[];
ignoreOrientationMismatch: boolean

If false, the document scanner will return OK_BUT_ORIENTATION_MISMATCH if the detected document orientation does not match the input image orientation, e.g. if the document is detected as landscape but the input image is portrait. If true, the document scanner will ignore orientation mismatches.

Default Value

false;
isLive: boolean

If true, the document scanner will return only the best document contour. If false, the document scanner will additionally return alternative document contours suitable for the cropping screen.

Default Value

false;

Generated using TypeDoc