Class RecognizerBundle
java.lang.Object
com.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>
com.microblink.photopay.entities.recognizers.RecognizerBundle
- All Implemented Interfaces:
android.os.Parcelable,com.microblink.photopay.intent.MBIntentTransferable
public class RecognizerBundle
extends com.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>
Represents a bundle of
Recognizer objects that can travel via Intent-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final android.os.Parcelable.Creator<RecognizerBundle>static final intConstant used as argument forsetNumMsBeforeTimeout(int)method when timeout should be set to infinity.Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionRecognizerBundle(Recognizer... recognizers) RecognizerBundle(List<Recognizer> recognizerList) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconsumeContentFromLoadedObject(RecognizerBundle loadedBundle) Consumes content from object loaded from intent.static final RecognizerBundlecreateFromIntent(android.content.Intent intent) Creates object of this class fromIntent.booleanprotected android.os.Parcelable.Creator<RecognizerBundle>Returns parcelable creator for concrete intent transferable type.intReturns the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.Returns the current recognition mode.Returns the array of recognizers associated with this bundle.protected StringReturns intent extra that will be used for transferring object unique ID.protected voidreadFromParcel(android.os.Parcel in) voidsaveToIntent(android.content.Intent intent) voidsetAllowMultipleScanResultsOnSingleImage(boolean multiScan) Sets whether or not outputting of multiple scan results from same image is allowed.voidSets the mode of the frame quality estimation.voidsetNumMsBeforeTimeout(int numMsBeforeTimeout) Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.voidsetRecognitionDebugMode(RecognizerBundle.RecognitionDebugMode recognitionMode) This method is for debugging and testing purposes only.booleanReturns true if multiple scan results can be obtained from single image.voidwriteToParcel(android.os.Parcel dest, int flags) Methods inherited from class com.microblink.photopay.intent.BaseIntentTransferable
clearSavedState, describeContents, existsInIntent, loadFromIntent, saveState
-
Field Details
-
TIMEOUT_INFINITY
public static final int TIMEOUT_INFINITYConstant used as argument forsetNumMsBeforeTimeout(int)method when timeout should be set to infinity. Effectively, this means that recognition timeout will be disabled. -
CREATOR
-
-
Constructor Details
-
RecognizerBundle
-
RecognizerBundle
-
-
Method Details
-
createFromIntent
@Nullable public static final RecognizerBundle createFromIntent(@NonNull android.content.Intent intent) Creates object of this class fromIntent.- Parameters:
intent- intent in which object is stored.- Returns:
- created object or
nullif it does not exist in the given intent.
-
getRecognizers
Returns the array of recognizers associated with this bundle.- Returns:
- the array of recognizers associated with this bundle.
-
getRecognitionDebugMode
Returns the current recognition mode.- Returns:
- the current recognition mode.
-
setRecognitionDebugMode
This method is for debugging and testing purposes only. Please do not use it because calling it with wrong parameter might cause scanning loop to never terminate.- Parameters:
recognitionMode- Requested mode of recognition.
-
shouldAllowMultipleScanResultsOnSingleImage
public boolean shouldAllowMultipleScanResultsOnSingleImage()Returns true if multiple scan results can be obtained from single image. SeesetAllowMultipleScanResultsOnSingleImage(boolean)for details.- Returns:
- true if multiple scan results can be obtained from single image.
-
setAllowMultipleScanResultsOnSingleImage
public void setAllowMultipleScanResultsOnSingleImage(boolean multiScan) Sets whether or not outputting of multiple scan results from same image is allowed. If that is true, it is possible to return multiple recognition results from same image. If this option is false, at most single recognizer inside this bundle will be updated with latest results. If this option is true, it is possible that multiple recognizers inside this bundle will be updated with latest results. The upside of setting that option to false is the speed - if you have lots of recognizers in this bundle, as soon as the first recognizer succeeds in scanning, recognition chain will be terminated and other recognizers will not get a chance to analyze the image. The downside is that you are then unable to obtain multiple results from single image. -
setNumMsBeforeTimeout
public void setNumMsBeforeTimeout(int numMsBeforeTimeout) Set the duration in milliseconds that needs to pass since scanning has begun in order to define timeout. Please be aware that time counting does not start from the moment when scanning starts. Instead it starts from the moment when at least oneRecognizer.Resultinside recognizers in this bundle changes its stateRecognizer.Result.getResultState()to eitherRecognizer.Result.State.UncertainorRecognizer.Result.State.Valid. The reason for this is the better user experience in cases when for example timeout is set to 10 seconds and user starts scanning and leaves device lying on table for 9 seconds and then points the device towards the object it wants to scan: in such case it is better to let that user scan the object it wants instead of completing scan with empty scan result as soon as 10 seconds timeout ticks out.- Parameters:
numMsBeforeTimeout- duration in milliseconds
-
getNumMsBeforeTimeout
public int getNumMsBeforeTimeout()Returns the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.- Returns:
- the duration in milliseconds that needs to pass since scanning has begun in order to define timeout.
- See Also:
-
setFrameQualityEstimationMode
public void setFrameQualityEstimationMode(@NonNull RecognizerBundle.FrameQualityEstimationMode mode) Sets the mode of the frame quality estimation. If automatic, it will be used if at least one enabled recognizer requires it or if device is fast enough to perform it always (default). If always on or always off, it will not depend on active recognizers nor device. Frame quality estimation helps choosing the best possible frame from camera stream for processing.- Parameters:
mode- Desired mode of frame quality estimation.
-
getFrameQualityEstimationMode
-
getUniqueIdIntentExtraKey
Description copied from class:com.microblink.photopay.intent.BaseIntentTransferableReturns intent extra that will be used for transferring object unique ID. Different concrete classes cannot use the same intent extra key for this purpose because that will make sending objects from different concrete classes over the same intent impossible.- Specified by:
getUniqueIdIntentExtraKeyin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>- Returns:
- intent extra that will be used for transferring object unique ID.
-
getConcreteCreator
Description copied from class:com.microblink.photopay.intent.BaseIntentTransferableReturns parcelable creator for concrete intent transferable type.- Specified by:
getConcreteCreatorin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>- Returns:
- parcelable creator for concrete intent transferable type.
-
consumeContentFromLoadedObject
Description copied from class:com.microblink.photopay.intent.BaseIntentTransferableConsumes content from object loaded from intent.- Specified by:
consumeContentFromLoadedObjectin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>
-
saveToIntent
public void saveToIntent(@NonNull android.content.Intent intent) - Specified by:
saveToIntentin interfacecom.microblink.photopay.intent.MBIntentTransferable- Overrides:
saveToIntentin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>- Parameters:
intent- Intent to whichRecognizerBundleshould be saved.
-
equals
-
readFromParcel
protected void readFromParcel(@NonNull android.os.Parcel in) - Overrides:
readFromParcelin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable- Overrides:
writeToParcelin classcom.microblink.photopay.intent.BaseIntentTransferable<RecognizerBundle>
-