DocumentScannerParameters class
Parameters for the document scanner.
Constructors
-
DocumentScannerParameters({int acceptedAngleScore = 75, int acceptedSizeScore = 80, int acceptedBrightnessThreshold = 0, int acceptedAspectRatioScore = 85, List<
AspectRatio> ? aspectRatios, bool ignoreOrientationMismatch = false}) -
DocumentScannerParameters.fromJson(Map<
String, dynamic> json) -
factory
Properties
- acceptedAngleScore ↔ int
-
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document.
Set lower values to accept more perspective distortion.
getter/setter pair
- acceptedAspectRatioScore ↔ int
-
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.
getter/setter pair
- acceptedBrightnessThreshold ↔ int
-
The minimum brightness value (0-255) to accept a detected document.
getter/setter pair
- acceptedSizeScore ↔ int
-
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.
getter/setter pair
-
aspectRatios
↔ List<
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.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreOrientationMismatch ↔ bool
-
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.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
{ToJsonConfiguration? config}) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited