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>acceptedDocumentTypesprivate Set<String>excludedFieldTypesprivate ResultAccumulationConfigresultAccumulationConfig
-
Constructor Summary
Constructors Constructor Description DefaultGenericDocumentRecognizer()
-
Method Summary
Modifier and Type Method Description List<RootDocumentType>getAcceptedDocumentTypes()Accepted document types. UnitsetAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)Accepted document types. Set<String>getExcludedFieldTypes()Set of secure fields which should be excluded from scanning process. UnitsetExcludedFieldTypes(Set<String> excludedFieldTypes)Set of secure fields which should be excluded from scanning process. ResultAccumulationConfiggetResultAccumulationConfig()Configuration for result accumulation UnitsetResultAccumulationConfig(ResultAccumulationConfig resultAccumulationConfig)Configuration for result accumulation GenericDocumentRecognitionResultscanBitmap(Bitmap bitmap, Boolean shouldRecognize, Integer orientation)Scan the image to detect document and recognize data on it GenericDocumentRecognitionResultscanJpeg(ByteArray jpeg, Boolean shouldRecognize, Integer orientation)Scan the image to detect document and recognize data on it GenericDocumentRecognitionResultscanNv21(ByteArray nv21, Integer width, Integer height, Integer orientation, Rect finderRect, Boolean shouldRecognize)Scan the image to detect document and recognize data on it Unitclear()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.
-
-
-
-