public final class MrtdRecognizer extends TemplatingRecognizer implements GlareDetectorOptions, FullDocumentImageOptions, FullDocumentImageDpiOptions, FullDocumentImageExtensionOptions, EncodeFullDocumentImagesOptions
Modifier and Type | Class and Description |
---|---|
static class |
MrtdRecognizer.Result |
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator |
CREATOR |
CLASS_NAME
CLASS_NAME
CLASS_NAME
CLASS_NAME
Constructor and Description |
---|
MrtdRecognizer() |
Modifier and Type | Method and Description |
---|---|
MrtdRecognizer |
clone()
Create a copy of the entity.
|
void |
consumeResultFrom(Entity other)
Consume result from other entity.
|
protected void |
deserializeNativeSettings(byte[] serializedSettings) |
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.
|
MrtdSpecification[] |
getSpecifications()
Returns the array of
MrtdSpecification objects that will define which MRTD documents
should be detectable. |
boolean |
isAllowSpecialCharacters()
Whether special characters are allowed.
|
boolean |
isAllowUnparsedResults()
Whether returning of unparsed results is allowed.
|
boolean |
isAllowUnverifiedResults()
Whether returning of unverified results is allowed.
|
protected void |
readFromParcel(android.os.Parcel in) |
protected byte[] |
serializeNativeSettings() |
void |
setAllowSpecialCharacters(boolean allowSpecialCharacters)
Whether special characters are allowed.
|
void |
setAllowUnparsedResults(boolean allowUnparsedResults)
Whether returning of unparsed results is allowed.
|
void |
setAllowUnverifiedResults(boolean allowUnverifiedResults)
Whether returning of unverified results is allowed.
|
void |
setDetectGlare(boolean detectGlare)
Defines whether glare detector will be used during recognition process.
|
void |
setEncodeFullDocumentImage(boolean encodeFullDocumentImage)
Sets whether full document image should be encoded in JPEG format and written into the corresponding
recognition result.
|
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 |
setMRZFilter(MrzFilter mrzFilter)
Sets the
MrzFilter that can determine whether document should be processed or filtered out. |
protected void |
setNativeTemplatingClasses(long[] nativeTemplatingClasses) |
void |
setReturnFullDocumentImage(boolean returnFullDocumentImage)
Sets whether full document image should be available in
FullDocumentImageResult . |
void |
setSpecifications(MrtdSpecification[] specifications)
Sets one or more
MrtdSpecification objects that will define which MRTD documents
should be detectable. |
boolean |
shouldDetectGlare()
Returns whether glare detector is enabled.
|
boolean |
shouldEncodeFullDocumentImage()
Returns whether encoding of full document images and writing them into the recognition result is enabled.
|
boolean |
shouldReturnFullDocumentImage()
Returns whether full document image will be available in
FullDocumentImageResult . |
protected void |
terminateNative(long nativeContext) |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
setTemplatingClasses
requiresAutofocus, requiresLandscapeMode
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext
public void setAllowSpecialCharacters(boolean allowSpecialCharacters)
public boolean isAllowSpecialCharacters()
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 setAllowUnverifiedResults(boolean allowUnverifiedResults)
public boolean isAllowUnverifiedResults()
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 setAllowUnparsedResults(boolean allowUnparsedResults)
public boolean isAllowUnparsedResults()
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 setNativeTemplatingClasses(@Nullable long[] nativeTemplatingClasses)
setNativeTemplatingClasses
in class TemplatingRecognizer
public void setSpecifications(@Nullable MrtdSpecification[] specifications)
MrtdSpecification
objects that will define which MRTD documents
should be detectable. Setting null or empty array will enable all possible specifications.specifications
- specifications for MRTD documents that should be detectable@NonNull public MrtdSpecification[] getSpecifications()
MrtdSpecification
objects that will define which MRTD documents
should be detectable.MrtdSpecification
objects that will define which MRTD documents
should be detectable.public void setMRZFilter(@Nullable MrzFilter mrzFilter)
MrzFilter
that can determine whether document should be processed or filtered out.mrzFilter
- MrzFilter
that can determine whether document should be processed or filtered out or null to allow processing of all documents.public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
writeToParcel
in class TemplatingRecognizer
protected void readFromParcel(@NonNull android.os.Parcel in)
readFromParcel
in class TemplatingRecognizer
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 MrtdRecognizer 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 TemplatingRecognizer
other
- Entity from which result should be consumed.