Class DefaultGenericDocumentRecognizer
-
- All Implemented Interfaces:
-
io.scanbot.sdk.genericdocument.GenericDocumentRecognizer
public final class DefaultGenericDocumentRecognizer implements GenericDocumentRecognizer
Default implementation for GenericDocumentRecognizer
-
-
Field Summary
Fields Modifier and Type Field Description private Float
acceptedSharpnessScore
private List<RootDocumentType>
acceptedDocumentTypes
private Set<String>
excludedFieldTypes
-
Constructor Summary
Constructors Constructor Description DefaultGenericDocumentRecognizer(BlobManager blobManager)
-
Method Summary
Modifier and Type Method Description Float
getAcceptedSharpnessScore()
Accepted minimal sharpness score. Unit
setAcceptedSharpnessScore(Float acceptedSharpnessScore)
Accepted minimal sharpness score. List<RootDocumentType>
getAcceptedDocumentTypes()
Accepted document types. Unit
setAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)
Accepted document types. Set<String>
getExcludedFieldTypes()
Set of secure fields which should be excluded from scanning process. Unit
setExcludedFieldTypes(Set<String> excludedFieldTypes)
Set of secure fields which should be excluded from scanning process. GenericDocumentRecognitionResult
scanBitmap(Bitmap bitmap, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it GenericDocumentRecognitionResult
scanJpeg(ByteArray jpeg, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it GenericDocumentRecognitionResult
scanNv21(ByteArray nv21, Integer width, Integer height, Integer orientation, Rect finderRect, Boolean shouldRecognize)
Scan the image to detect document and recognize data on it Unit
clear()
Clears the result accumulation cache (for live detection) -
-
Constructor Detail
-
DefaultGenericDocumentRecognizer
DefaultGenericDocumentRecognizer(BlobManager blobManager)
-
-
Method Detail
-
getAcceptedSharpnessScore
Float getAcceptedSharpnessScore()
Accepted minimal sharpness score. Images with a score less than that will be rejected with GenericDocumentRecognitionResult.RecognitionStatus.ErrorTooBlurry.
Default is 0
0 - any image will be accepted. 80 - a good compromise; the recommended setting. 100 - only very sharp images will be accepted.
-
setAcceptedSharpnessScore
Unit setAcceptedSharpnessScore(Float acceptedSharpnessScore)
Accepted minimal sharpness score. Images with a score less than that will be rejected with GenericDocumentRecognitionResult.RecognitionStatus.ErrorTooBlurry.
Default is 0
0 - any image will be accepted. 80 - a good compromise; the recommended setting. 100 - only very sharp images will be accepted.
-
getAcceptedDocumentTypes
List<RootDocumentType> getAcceptedDocumentTypes()
Accepted document types. All other document types will be ignored.
By default - GenericDocumentRecognizer.ACCEPTED_TYPES
-
setAcceptedDocumentTypes
Unit setAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)
Accepted document types. All other document types will be ignored.
By default - GenericDocumentRecognizer.ACCEPTED_TYPES
-
getExcludedFieldTypes
Set<String> getExcludedFieldTypes()
Set of secure fields which should be excluded from scanning process. All other fields will be scanned as usual. Field should be set ONLY as normalized field name. Example: DePassport.NormalizedFieldNames.NATIONALITY or DeIdCardBack.NormalizedFieldNames.HEIGHT
By default - empty and all fields are scanned
-
setExcludedFieldTypes
Unit setExcludedFieldTypes(Set<String> excludedFieldTypes)
Set of secure fields which should be excluded from scanning process. All other fields will be scanned as usual. Field should be set ONLY as normalized field name. Example: DePassport.NormalizedFieldNames.NATIONALITY or DeIdCardBack.NormalizedFieldNames.HEIGHT
By default - empty and all fields are scanned
-
scanBitmap
GenericDocumentRecognitionResult scanBitmap(Bitmap bitmap, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it
- Parameters:
bitmap
- imageshouldRecognize
- whether to recognize field and their data.orientation
- image orientation.
-
scanJpeg
GenericDocumentRecognitionResult scanJpeg(ByteArray jpeg, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it
- Parameters:
jpeg
- image in form of jpeg-encoded byte arrayshouldRecognize
- whether to recognize field and their data.orientation
- image orientation.
-
scanNv21
GenericDocumentRecognitionResult scanNv21(ByteArray nv21, Integer width, Integer height, Integer orientation, Rect finderRect, Boolean shouldRecognize)
Scan the image to detect document and recognize data on it
- Parameters:
nv21
- image in form of nv21-encoded byte arraywidth
- image width, pixelsheight
- image height, pixelsorientation
- image orientation.finderRect
- if non-null - perform scanning only in given area.shouldRecognize
- whether to recognize field and their data.
-
-
-
-