Class DocumentScannerParameters
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class DocumentScannerParameters implements Parcelable
Parameters for the document scanner.
-
-
Field Summary
Fields Modifier and Type Field Description private IntegeracceptedAngleScoreprivate IntegeracceptedSizeScoreprivate IntegeracceptedBrightnessThresholdprivate IntegeracceptedAspectRatioScoreprivate List<AspectRatio>aspectRatiosprivate BooleanignoreOrientationMismatch
-
Constructor Summary
Constructors Constructor Description DocumentScannerParameters(Map<String, Object> source)DocumentScannerParameters(JSONObject json)DocumentScannerParameters(Integer acceptedAngleScore, Integer acceptedSizeScore, Integer acceptedBrightnessThreshold, Integer acceptedAspectRatioScore, List<AspectRatio> aspectRatios, Boolean ignoreOrientationMismatch)
-
Method Summary
Modifier and Type Method Description final IntegergetAcceptedAngleScore()The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. final UnitsetAcceptedAngleScore(Integer acceptedAngleScore)The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. final IntegergetAcceptedSizeScore()The minimum size in percent (0 - 100) of the screen size to accept a detected document. final UnitsetAcceptedSizeScore(Integer acceptedSizeScore)The minimum size in percent (0 - 100) of the screen size to accept a detected document. final IntegergetAcceptedBrightnessThreshold()The minimum brightness value (0-255) to accept a detected document. final UnitsetAcceptedBrightnessThreshold(Integer acceptedBrightnessThreshold)The minimum brightness value (0-255) to accept a detected document. final IntegergetAcceptedAspectRatioScore()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. final UnitsetAcceptedAspectRatioScore(Integer acceptedAspectRatioScore)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. final List<AspectRatio>getAspectRatios()The possible desired aspect ratios for the detected document. final UnitsetAspectRatios(List<AspectRatio> aspectRatios)The possible desired aspect ratios for the detected document. final BooleangetIgnoreOrientationMismatch()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. final UnitsetIgnoreOrientationMismatch(Boolean ignoreOrientationMismatch)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. final JSONObjecttoJson(ToJsonConfiguration config)final DocumentScannerParametersclone()final static DocumentScannerParametersdefault()-
-
Constructor Detail
-
DocumentScannerParameters
DocumentScannerParameters(JSONObject json)
-
-
Method Detail
-
getAcceptedAngleScore
final Integer getAcceptedAngleScore()
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 is 75
-
setAcceptedAngleScore
final Unit setAcceptedAngleScore(Integer acceptedAngleScore)
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 is 75
-
getAcceptedSizeScore
final Integer getAcceptedSizeScore()
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 is 80
-
setAcceptedSizeScore
final Unit setAcceptedSizeScore(Integer acceptedSizeScore)
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 is 80
-
getAcceptedBrightnessThreshold
final Integer getAcceptedBrightnessThreshold()
The minimum brightness value (0-255) to accept a detected document.
Default is 0
-
setAcceptedBrightnessThreshold
final Unit setAcceptedBrightnessThreshold(Integer acceptedBrightnessThreshold)
The minimum brightness value (0-255) to accept a detected document.
Default is 0
-
getAcceptedAspectRatioScore
final Integer getAcceptedAspectRatioScore()
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 is 85
-
setAcceptedAspectRatioScore
final Unit setAcceptedAspectRatioScore(Integer acceptedAspectRatioScore)
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 is 85
-
getAspectRatios
final List<AspectRatio> getAspectRatios()
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.
-
setAspectRatios
final Unit setAspectRatios(List<AspectRatio> aspectRatios)
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.
-
getIgnoreOrientationMismatch
final Boolean getIgnoreOrientationMismatch()
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 is false
-
setIgnoreOrientationMismatch
final Unit setIgnoreOrientationMismatch(Boolean ignoreOrientationMismatch)
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 is false
-
toJson
final JSONObject toJson(ToJsonConfiguration config)
-
clone
final DocumentScannerParameters clone()
-
default
final static DocumentScannerParameters default()
-
-
-
-