DocumentScannerParameters

data class DocumentScannerParameters(var acceptedAngleScore: Int = 75, var acceptedSizeScore: Int = 80, var acceptedBrightnessThreshold: Int = 0, var acceptedAspectRatioScore: Int = 85, var aspectRatios: List<AspectRatio> = listOf( ), var ignoreOrientationMismatch: Boolean = false) : Parcelable

Parameters for the document scanner.

Constructors

Link copied to clipboard
constructor(source: Map<String, Any?>)
constructor(json: JSONObject)
constructor(acceptedAngleScore: Int = 75, acceptedSizeScore: Int = 80, acceptedBrightnessThreshold: Int = 0, acceptedAspectRatioScore: Int = 85, aspectRatios: List<AspectRatio> = listOf( ), ignoreOrientationMismatch: Boolean = false)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Functions

Link copied to clipboard
Link copied to clipboard
fun toJson(config: ToJsonConfiguration = ToJsonConfiguration.default()): JSONObject