Class DocumentCaptureRecognizer
java.lang.Object
com.microblink.blinkinput.entities.Entity<T>
com.microblink.blinkinput.entities.recognizers.Recognizer<DocumentCaptureRecognizer.Result>
com.microblink.blinkinput.entities.recognizers.blinkinput.documentcapture.DocumentCaptureRecognizer
- All Implemented Interfaces:
android.os.Parcelable,EncodeFullDocumentImagesOptions,FullDocumentImageExtensionOptions,FullDocumentImageOptions
public final class DocumentCaptureRecognizer
extends Recognizer<DocumentCaptureRecognizer.Result>
implements FullDocumentImageOptions, FullDocumentImageExtensionOptions, EncodeFullDocumentImagesOptions
A generic document capture recognizer.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final android.os.Parcelable.Creator<DocumentCaptureRecognizer>Fields inherited from interface com.microblink.blinkinput.entities.recognizers.blinkid.imageoptions.encode.EncodeFullDocumentImagesOptions
CLASS_NAMEFields inherited from interface com.microblink.blinkinput.entities.recognizers.blinkid.imageoptions.FullDocumentImageOptions
CLASS_NAMEFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Create a copy of the entity.voidconsumeResultFrom(Entity other) Consume result from other entity.protected voiddeserializeNativeSettings(byte[] serializedSettings) Returns the extension factors for full document image.floatDefines minimum document scale calculated as ratio of minimal document dimension and minimal dimension of the input image.intMinimum number of stable detections required for detection to be successful.protected byte[]voidsetEncodeFullDocumentImage(boolean encodeFullDocumentImage) Sets whether full document image should be encoded in JPEG format and written into the corresponding recognition result.voidsetFullDocumentImageExtensionFactors(ImageExtensionFactors fullDocumentImageExtensionFactors) Sets extension factors for full document image.voidsetMinDocumentScale(float minDocumentScale) Defines minimum document scale calculated as ratio of minimal document dimension and minimal dimension of the input image.voidsetNumStableDetectionsThreshold(int numStableDetectionsThreshold) Minimum number of stable detections required for detection to be successful.voidsetReturnFullDocumentImage(boolean returnFullDocumentImage) Sets whether full document image should be available inFullDocumentImageResult.booleanReturns whether encoding of full document images and writing them into the recognition result is enabled.booleanReturns whether full document image will be available inFullDocumentImageResult.protected voidterminateNative(long nativeContext) Methods inherited from class com.microblink.blinkinput.entities.recognizers.Recognizer
getName, isExcludedFromPing, requiresAutofocus, requiresLandscapeModeMethods inherited from class com.microblink.blinkinput.entities.Entity
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext, readFromParcel, writeToParcel
-
Field Details
-
CREATOR
-
-
Constructor Details
-
DocumentCaptureRecognizer
public DocumentCaptureRecognizer()
-
-
Method Details
-
setReturnFullDocumentImage
public void setReturnFullDocumentImage(boolean returnFullDocumentImage) Description copied from interface:FullDocumentImageOptionsSets whether full document image should be available inFullDocumentImageResult. If enabled, get image usingFullDocumentImageResult.getFullDocumentImage()By default, this is set to 'false'. IMPORTANT NOTE: If you setMicroblinkSDK.setIntentDataTransferMode(com.microblink.blinkinput.intent.IntentDataTransferMode)toIntentDataTransferMode.STANDARDrecognizer which contains encoded image cannot be parcelized and passed byIntentextras because of Android limitations on intent extras size. If you are using one of the provided scan activities and expect receiving scan results inActivity.onActivityResult(int, int, android.content.Intent)method use eitherIntentDataTransferMode.OPTIMISEDorIntentDataTransferMode.PERSISTED_OPTIMISEDBy default, this is set to 'false'- Specified by:
setReturnFullDocumentImagein interfaceFullDocumentImageOptions- Parameters:
returnFullDocumentImage- whether full document image will be available inFullDocumentImageResult.
-
shouldReturnFullDocumentImage
public boolean shouldReturnFullDocumentImage()Description copied from interface:FullDocumentImageOptionsReturns whether full document image will be available inFullDocumentImageResult. By default, this is set to 'false'. By default, this is set to 'false'- Specified by:
shouldReturnFullDocumentImagein interfaceFullDocumentImageOptions- Returns:
- whether full document image will be available in
FullDocumentImageResult.
-
setEncodeFullDocumentImage
public void setEncodeFullDocumentImage(boolean encodeFullDocumentImage) Description copied from interface:EncodeFullDocumentImagesOptionsSets whether full document image should be encoded in JPEG format and written into the corresponding recognition result. By default, this is set to 'false'.
IMPORTANT NOTE: If you setMicroblinkSDK.setIntentDataTransferMode(com.microblink.blinkinput.intent.IntentDataTransferMode)toIntentDataTransferMode.STANDARDrecognizer which contains encoded image cannot be parcelized and passed byIntentextras because of Android limitations on intent extras size. If you are using one of the provided scan activities and expect receiving scan results inActivity.onActivityResult(int, int, Intent)method use eitherIntentDataTransferMode.OPTIMISEDorIntentDataTransferMode.PERSISTED_OPTIMISED- Specified by:
setEncodeFullDocumentImagein interfaceEncodeFullDocumentImagesOptions- Parameters:
encodeFullDocumentImage- whether full document images should be encoded in JPEG format and written into the corresponding recognition result.
-
shouldEncodeFullDocumentImage
public boolean shouldEncodeFullDocumentImage()Description copied from interface:EncodeFullDocumentImagesOptionsReturns whether encoding of full document images and writing them into the recognition result is enabled. By default, this is set to 'false'.- Specified by:
shouldEncodeFullDocumentImagein interfaceEncodeFullDocumentImagesOptions- Returns:
- whether encoding of full document images and writing them into the recognition result is enabled.
-
setNumStableDetectionsThreshold
public void setNumStableDetectionsThreshold(@IntRange(from=1L,to=255L) int numStableDetectionsThreshold) Minimum number of stable detections required for detection to be successful. By default, this is set to '2'. -
getNumStableDetectionsThreshold
@IntRange(from=1L, to=255L) public int getNumStableDetectionsThreshold()Minimum number of stable detections required for detection to be successful. By default, this is set to '2'. -
setMinDocumentScale
public void setMinDocumentScale(@FloatRange(from=0.0,to=1.0) float minDocumentScale) Defines minimum document scale calculated as ratio of minimal document dimension and minimal dimension of the input image. By default, this is set to '0.5'. -
getMinDocumentScale
@FloatRange(from=0.0, to=1.0) public float getMinDocumentScale()Defines minimum document scale calculated as ratio of minimal document dimension and minimal dimension of the input image. By default, this is set to '0.5'. -
setFullDocumentImageExtensionFactors
public void setFullDocumentImageExtensionFactors(@NonNull ImageExtensionFactors fullDocumentImageExtensionFactors) Sets extension factors for full document image. By default, this is set to '[0.0, 0.0, 0.0, 0.0]'.- Specified by:
setFullDocumentImageExtensionFactorsin interfaceFullDocumentImageExtensionOptions- Parameters:
fullDocumentImageExtensionFactors- extension factors for full document image.
-
getFullDocumentImageExtensionFactors
Returns the extension factors for full document image. By default, this is set to '[0.0, 0.0, 0.0, 0.0]'.- Specified by:
getFullDocumentImageExtensionFactorsin interfaceFullDocumentImageExtensionOptions- Returns:
- extension factors for full document image.
-
terminateNative
protected void terminateNative(long nativeContext) - Specified by:
terminateNativein classEntity<DocumentCaptureRecognizer.Result>
-
serializeNativeSettings
@Nullable protected byte[] serializeNativeSettings()- Specified by:
serializeNativeSettingsin classEntity<DocumentCaptureRecognizer.Result>
-
deserializeNativeSettings
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings) - Specified by:
deserializeNativeSettingsin classEntity<DocumentCaptureRecognizer.Result>
-
clone
Description copied from class:EntityCreate a copy of the entity. This is required if properties of the entity must be modified while background thread performs processing. In order to avoid race conditions, changing properties is not allowed while entity is used in background processing. However, you are able to make a copy of the entity, change properties of it and then update theRecognizerRunnerVieworRecognizerRunnerwith the updated entity hierarchy.- Specified by:
clonein classRecognizer<DocumentCaptureRecognizer.Result>- Returns:
- a copy of the entity
-
consumeResultFrom
Description copied from class:EntityConsume result from other entity. The result from other will be put instead current result of this entity. This method is used insideBaseIntentTransferable.loadFromIntent(Intent)and similar methods to replace the result content of the saved entities with results that have arrived overIntent- Specified by:
consumeResultFromin classEntity<DocumentCaptureRecognizer.Result>- Parameters:
other- Entity from which result should be consumed.
-