KtpScanConfig

data class KtpScanConfig(val aspectTolerance: Double = 0.15, val minCardWidthPx: Int = 500, val minBlurScore: Double = 40.0, val maxGlareRatio: Double = 0.03, val portraitRegion: Rect = Rect(0.6, 0.2, 1.0, 0.95))

Thresholds for KtpScanner. Defaults are starting points to calibrate on your own devices and backgrounds.

Constructors

Link copied to clipboard
constructor(aspectTolerance: Double = 0.15, minCardWidthPx: Int = 500, minBlurScore: Double = 40.0, maxGlareRatio: Double = 0.03, portraitRegion: Rect = Rect(0.6, 0.2, 1.0, 0.95))

Properties

Link copied to clipboard

allowed relative deviation of the card's long/short side ratio from KtpSpec.ASPECT_RATIO; generous by default because perspective foreshortens edges before rectification

Link copied to clipboard

maximum fraction of saturated pixels on the rectified card

Link copied to clipboard

minimum Laplacian variance of the rectified card (normalised to 512 px)

Link copied to clipboard

minimum length of the card's long side in the source image

Link copied to clipboard

where the portrait's centre must fall, as fractions of the rectified card