public class NativeIdCardScanner
Wrapper for JNI IdCardScanner
public NativeIdCardScanner(@NotNull
java.lang.String tessDataPath,
boolean accumulateFrames)
Wrapper for JNI IdCardScanner
tessDataPath - Path to OCR blobs, needed for optical recognition of detected ID card fieldsaccumulateFrames - true - the recognizer will merge together results with the same document type and return the merged document.Call clear() to clear the live cache.false - no accumulation done.@Synchronized @Nullable public IdScanResult scanBitmap(@NotNull android.graphics.Bitmap bitmap, boolean shouldRecognize, int orientation)
Scan image to detect ID card and data on it
bitmap - imageshouldRecognize - whether to recognize field and their data on ID card. Defaults to trueorientation - image orientation. Default is 0@Synchronized @Nullable public IdScanResult scanJpeg(@NotNull kotlin.Array[] jpeg, boolean shouldRecognize, int orientation)
Scan image to detect ID card and data on it
jpeg - image in form of jpeg-encoded byte arrayshouldRecognize - whether to recognize field and their data on ID card. Defaults to trueorientation - image orientation. Default is 0@Synchronized @Nullable public IdScanResult scanNv21(@NotNull kotlin.Array[] nv21, int width, int height, int orientation, @Nullable android.graphics.Rect finderRect, boolean shouldRecognize)
Scan image to detect ID card and 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 on ID card. Defaults to true@Synchronized public void setAcceptedSharpnessScore(float acceptedSharpnessScore)
Accepted minimal sharpness score. Images with a score less than that will be rejected with 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.
@Synchronized
public void setAcceptedDocumentTypes(@NotNull
java.util.List<? extends io.scanbot.idcardscanner.IdScanResult.DocumentType> acceptedDocumentTypes)
Accepted document types. All other document types will be ignored.
By default - all document types are accepted.
@Synchronized public void clear()
Clears the result accumulation cache (see accumulateFrames).
protected void finalize()