public final class PassportRecognizer extends Recognizer implements GlareDetectorOptions, FaceImageOptions, FaceImageDpiOptions, EncodeFaceImageOptions, FullDocumentImageOptions, FullDocumentImageDpiOptions, FullDocumentImageExtensionOptions, EncodeFullDocumentImagesOptions
Modifier and Type | Class and Description |
---|---|
static class |
PassportRecognizer.Result |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator |
CREATOR |
CLASS_NAME
CLASS_NAME
CLASS_NAME
CLASS_NAME
CLASS_NAME
Constructor and Description |
---|
PassportRecognizer() |
Modifier and Type | Method and Description |
---|---|
PassportRecognizer |
clone()
Create a copy of the entity.
|
void |
consumeResultFrom(Entity other)
Consume result from other entity.
|
protected void |
deserializeNativeSettings(byte[] serializedSettings) |
int |
getFaceImageDpi()
Returns the DPI (Dots Per Inch) for face image that should be returned.
|
int |
getFullDocumentImageDpi()
Returns the DPI (Dots Per Inch) for full document image that should be returned.
|
ImageExtensionFactors |
getFullDocumentImageExtensionFactors()
Returns the extension factors for full document image.
|
protected byte[] |
serializeNativeSettings() |
void |
setDetectGlare(boolean detectGlare)
Defines whether glare detector will be used during recognition process.
|
void |
setEncodeFaceImage(boolean encodeFaceImage)
Sets whether face image from document should be encoded in JPEG format and written into the corresponding
recognition result.
|
void |
setEncodeFullDocumentImage(boolean encodeFullDocumentImage)
Sets whether full document image should be encoded in JPEG format and written into the corresponding
recognition result.
|
void |
setFaceImageDpi(int desiredDPI)
Sets desired DPI (Dots Per Inch) for face image that should be returned.
|
void |
setFullDocumentImageDpi(int desiredDPI)
Sets desired DPI (Dots Per Inch) for full document image that should be returned.
|
void |
setFullDocumentImageExtensionFactors(ImageExtensionFactors fullDocumentImageExtensionFactors)
Sets extension factors for full document image.
|
void |
setReturnFaceImage(boolean returnFaceImage)
Sets whether face image from document should be available in
FaceImageResult . |
void |
setReturnFullDocumentImage(boolean returnFullDocumentImage)
Sets whether full document image should be available in
FullDocumentImageResult . |
boolean |
shouldDetectGlare()
Returns whether glare detector is enabled.
|
boolean |
shouldEncodeFaceImage()
Returns whether encoding of face image from document and writing it into the recognition result is enabled.
|
boolean |
shouldEncodeFullDocumentImage()
Returns whether encoding of full document images and writing them into the recognition result is enabled.
|
boolean |
shouldReturnFaceImage()
Returns whether face image will be available in
FaceImageResult . |
boolean |
shouldReturnFullDocumentImage()
Returns whether full document image will be available in
FullDocumentImageResult . |
protected void |
terminateNative(long nativeContext) |
requiresAutofocus, requiresLandscapeMode
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext, readFromParcel, writeToParcel
public void setReturnFaceImage(boolean returnFaceImage)
FaceImageOptions
FaceImageResult
.
If enabled, get image using FaceImageResult.getFaceImage()
By default, this is set to 'false'.
IMPORTANT NOTE: If you set
MicroblinkSDK.setIntentDataTransferMode(com.microblink.intent.IntentDataTransferMode)
to IntentDataTransferMode.STANDARD
recognizer which contains encoded image
cannot be parcelized and passed by Intent
extras because of Android limitations
on intent extras size.
If you are using one of the provided scan activities and expect receiving scan results in
Activity.onActivityResult(int, int, android.content.Intent)
method
use either IntentDataTransferMode.OPTIMISED
or IntentDataTransferMode.PERSISTED_OPTIMISED
setReturnFaceImage
in interface FaceImageOptions
returnFaceImage
- whether face image will be available in FaceImageResult
.public boolean shouldReturnFaceImage()
FaceImageOptions
FaceImageResult
.
By default, this is set to 'false'.shouldReturnFaceImage
in interface FaceImageOptions
FaceImageResult
.public void setDetectGlare(boolean detectGlare)
GlareDetectorOptions
true
and glare detector is used. If the glare detector is used and
GlareCallback
is set to MetadataCallbacks
,
it will receive glare status will. Also when glare is detected OCR will not be performed on
the affected document position to prevent errors in the extracted data.
By default, this is set to 'true'.setDetectGlare
in interface GlareDetectorOptions
detectGlare
- whether glare detector will be used during recognition process.public boolean shouldDetectGlare()
GlareDetectorOptions
shouldDetectGlare
in interface GlareDetectorOptions
true
, otherwise returns false
.public void setReturnFullDocumentImage(boolean returnFullDocumentImage)
FullDocumentImageOptions
FullDocumentImageResult
.
If enabled, get image using
FullDocumentImageResult.getFullDocumentImage()
By default, this is set to 'false'.
IMPORTANT NOTE: If you set
MicroblinkSDK.setIntentDataTransferMode(com.microblink.intent.IntentDataTransferMode)
to IntentDataTransferMode.STANDARD
recognizer which contains encoded image
cannot be parcelized and passed by Intent
extras because of Android limitations
on intent extras size.
If you are using one of the provided scan activities and expect receiving scan results in
Activity.onActivityResult(int, int, android.content.Intent)
method
use either IntentDataTransferMode.OPTIMISED
or IntentDataTransferMode.PERSISTED_OPTIMISED
By default, this is set to 'false'setReturnFullDocumentImage
in interface FullDocumentImageOptions
returnFullDocumentImage
- whether full document image will be available in
FullDocumentImageResult
.public boolean shouldReturnFullDocumentImage()
FullDocumentImageOptions
FullDocumentImageResult
.
By default, this is set to 'false'.
By default, this is set to 'false'shouldReturnFullDocumentImage
in interface FullDocumentImageOptions
FullDocumentImageResult
.public void setEncodeFullDocumentImage(boolean encodeFullDocumentImage)
EncodeFullDocumentImagesOptions
MicroblinkSDK.setIntentDataTransferMode(com.microblink.intent.IntentDataTransferMode)
to IntentDataTransferMode.STANDARD
recognizer which contains encoded image
cannot be parcelized and passed by Intent
extras because of Android limitations
on intent extras size.
If you are using one of the provided scan activities and expect receiving scan results in
Activity.onActivityResult(int, int, Intent)
method
use either IntentDataTransferMode.OPTIMISED
or IntentDataTransferMode.PERSISTED_OPTIMISED
setEncodeFullDocumentImage
in interface EncodeFullDocumentImagesOptions
encodeFullDocumentImage
- whether full document images should be encoded in JPEG format and written into the
corresponding recognition result.public boolean shouldEncodeFullDocumentImage()
EncodeFullDocumentImagesOptions
shouldEncodeFullDocumentImage
in interface EncodeFullDocumentImagesOptions
public void setEncodeFaceImage(boolean encodeFaceImage)
EncodeFaceImageOptions
MicroblinkSDK.setIntentDataTransferMode(com.microblink.intent.IntentDataTransferMode)
to IntentDataTransferMode.STANDARD
recognizer which contains encoded image
cannot be parcelized and passed by Intent
extras because of Android limitations
on intent extras size.
If you are using one of the provided scan activities and expect receiving scan results in
Activity.onActivityResult(int, int, android.content.Intent)
method
use either IntentDataTransferMode.OPTIMISED
or IntentDataTransferMode.PERSISTED_OPTIMISED
setEncodeFaceImage
in interface EncodeFaceImageOptions
encodeFaceImage
- whether face image should be encoded in JPEG format and written into the
corresponding recognition result.public boolean shouldEncodeFaceImage()
EncodeFaceImageOptions
shouldEncodeFaceImage
in interface EncodeFaceImageOptions
public int getFaceImageDpi()
getFaceImageDpi
in interface FaceImageDpiOptions
public void setFaceImageDpi(int desiredDPI)
setFaceImageDpi
in interface FaceImageDpiOptions
desiredDPI
- desired DPI in range [100, 400]public int getFullDocumentImageDpi()
getFullDocumentImageDpi
in interface FullDocumentImageDpiOptions
public void setFullDocumentImageDpi(int desiredDPI)
setFullDocumentImageDpi
in interface FullDocumentImageDpiOptions
desiredDPI
- desired DPI in range [100, 400]public void setFullDocumentImageExtensionFactors(@NonNull ImageExtensionFactors fullDocumentImageExtensionFactors)
setFullDocumentImageExtensionFactors
in interface FullDocumentImageExtensionOptions
fullDocumentImageExtensionFactors
- extension factors for full document image.@NonNull public ImageExtensionFactors getFullDocumentImageExtensionFactors()
getFullDocumentImageExtensionFactors
in interface FullDocumentImageExtensionOptions
protected void terminateNative(long nativeContext)
terminateNative
in class Entity
@Nullable protected byte[] serializeNativeSettings()
serializeNativeSettings
in class Entity
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings)
deserializeNativeSettings
in class Entity
public PassportRecognizer clone()
Entity
RecognizerRunnerView
or RecognizerRunner
with the updated entity hierarchy.clone
in class Recognizer
public void consumeResultFrom(@NonNull Entity other)
Entity
com.microblink.entities.recognizers.RecognizerBundle#loadFromIntent(Intent)
and similar methods to replace the result content of the saved entities with results that
have arrived over Intent
consumeResultFrom
in class Entity
other
- Entity from which result should be consumed.