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 List<RootDocumentType>
acceptedDocumentTypes
private Set<String>
excludedFieldTypes
private ResultAccumulationConfig
resultAccumulationConfig
-
Constructor Summary
Constructors Constructor Description DefaultGenericDocumentRecognizer()
-
Method Summary
Modifier and Type Method Description 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. ResultAccumulationConfig
getResultAccumulationConfig()
Configuration for result accumulation Unit
setResultAccumulationConfig(ResultAccumulationConfig resultAccumulationConfig)
Configuration for result accumulation 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) -
-
Method Detail
-
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
-
getResultAccumulationConfig
ResultAccumulationConfig getResultAccumulationConfig()
Configuration for result accumulation
-
setResultAccumulationConfig
Unit setResultAccumulationConfig(ResultAccumulationConfig resultAccumulationConfig)
Configuration for result accumulation
-
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.
-
-
-
-