Interface GenericDocumentRecognizer
-
- All Implemented Interfaces:
public interface GenericDocumentRecognizer
Component to scan image, detect different documents of known types, perform image optimization, cropping and (optionally) fields detection and fields' data recognition
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
GenericDocumentRecognizer.Companion
-
Method Summary
Modifier and Type Method Description abstract GenericDocumentRecognitionResult
scanBitmap(Bitmap bitmap, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it abstract GenericDocumentRecognitionResult
scanJpeg(ByteArray jpeg, Boolean shouldRecognize, Integer orientation)
Scan the image to detect document and recognize data on it abstract 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 abstract Unit
clear()
Clears the result accumulation cache (for live detection) abstract List<RootDocumentType>
getAcceptedDocumentTypes()
Accepted document types. abstract Unit
setAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)
Accepted document types. abstract Set<String>
getExcludedFieldTypes()
Set of secure fields which should be excluded from scanning process. abstract Unit
setExcludedFieldTypes(Set<String> excludedFieldTypes)
Set of secure fields which should be excluded from scanning process. abstract ResultAccumulationConfig
getResultAccumulationConfig()
Configuration for result accumulation abstract Unit
setResultAccumulationConfig(ResultAccumulationConfig resultAccumulationConfig)
Configuration for result accumulation -
-
Method Detail
-
scanBitmap
abstract 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
abstract 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
abstract 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.
-
getAcceptedDocumentTypes
abstract List<RootDocumentType> getAcceptedDocumentTypes()
Accepted document types. All other document types will be ignored.
By default - GenericDocumentRecognizer.ACCEPTED_TYPES
-
setAcceptedDocumentTypes
abstract Unit setAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)
Accepted document types. All other document types will be ignored.
By default - GenericDocumentRecognizer.ACCEPTED_TYPES
-
getExcludedFieldTypes
abstract 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
abstract 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
abstract ResultAccumulationConfig getResultAccumulationConfig()
Configuration for result accumulation
-
setResultAccumulationConfig
abstract Unit setResultAccumulationConfig(ResultAccumulationConfig resultAccumulationConfig)
Configuration for result accumulation
-
-
-
-