public class DefaultGenericDocumentRecognizer implements GenericDocumentRecognizer
Default implementation for interface GenericDocumentRecognizer
interface GenericDocumentRecognizerpublic DefaultGenericDocumentRecognizer(@NotNull
io.scanbot.sdk.blob.BlobManager blobManager)
Default implementation for interface GenericDocumentRecognizer
interface GenericDocumentRecognizerpublic 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.
public void setAcceptedSharpnessScore(float value)
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.
@NotNull public java.util.List<io.scanbot.genericdocument.entity.RootDocumentType> getAcceptedDocumentTypes()
Accepted document types. All other document types will be ignored.
By default - RootDocumentType.ALL_TYPES
public void setAcceptedDocumentTypes(@NotNull
java.util.List<? extends io.scanbot.genericdocument.entity.RootDocumentType> value)
Accepted document types. All other document types will be ignored.
By default - RootDocumentType.ALL_TYPES
@Nullable public GenericDocumentRecognitionResult scanBitmap(@NotNull android.graphics.Bitmap bitmap, boolean shouldRecognize, int orientation)
Scan the image to detect document and recognize data on it
bitmap - imageshouldRecognize - whether to recognize field and their data. Otherwise the component will only detect document on the image. Defaults to trueorientation - image orientation. Default is 0@Nullable public GenericDocumentRecognitionResult scanJpeg(@NotNull kotlin.Array[] jpeg, boolean shouldRecognize, int orientation)
Scan the image to detect document and recognize data on it
jpeg - image in form of jpeg-encoded byte arrayshouldRecognize - whether to recognize field and their data. Otherwise the component will only detect document on the image. Defaults to trueorientation - image orientation. Default is 0@Nullable public GenericDocumentRecognitionResult scanNv21(@NotNull kotlin.Array[] nv21, int width, int height, int orientation, @Nullable android.graphics.Rect finderRect, boolean shouldRecognize)
Scan the image to detect document and recognize data on it
nv21 - image in form of nv21-encoded byte arraywidth - image width, pixelsheight - image height, pixelsorientation - image orientation. Default is 0finderRect - if non-null - perform scanning only in given area. Default is nullshouldRecognize - whether to recognize field and their data. Otherwise the component will only detect document on the image. Defaults to truepublic void clear()
Clears the result accumulation cache (for live detection)