-
- 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 FloatacceptedSharpnessScoreprivate List<RootDocumentType>acceptedDocumentTypes
-
Constructor Summary
Constructors Constructor Description DefaultGenericDocumentRecognizer(BlobManager blobManager)
-
Method Summary
Modifier and Type Method Description FloatgetAcceptedSharpnessScore()Accepted minimal sharpness score. UnitsetAcceptedSharpnessScore(Float acceptedSharpnessScore)List<RootDocumentType>getAcceptedDocumentTypes()Accepted document types. UnitsetAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)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
-
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)
-
getAcceptedDocumentTypes
List<RootDocumentType> getAcceptedDocumentTypes()
Accepted document types. All other document types will be ignored.
By default - RootDocumentType.ALL_TYPES
-
setAcceptedDocumentTypes
Unit setAcceptedDocumentTypes(List<RootDocumentType> acceptedDocumentTypes)
-
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.
-
-
-
-