Class BlinkCardRecognizer
java.lang.Object
com.microblink.blinkcard.entities.Entity<T>
com.microblink.blinkcard.entities.recognizers.Recognizer<BlinkCardRecognizer.Result>
com.microblink.blinkcard.entities.recognizers.blinkcard.BlinkCardRecognizer
- All Implemented Interfaces:
android.os.Parcelable,CombinedRecognizer,FullDocumentImageDpiOptions,EncodeFullDocumentImagesOptions,FullDocumentImageExtensionOptions,FullDocumentImageOptions
public final class BlinkCardRecognizer
extends Recognizer<BlinkCardRecognizer.Result>
implements CombinedRecognizer, FullDocumentImageOptions, FullDocumentImageDpiOptions, FullDocumentImageExtensionOptions, EncodeFullDocumentImagesOptions
Recognizer used for scanning both sides of payment cards.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface com.microblink.blinkcard.entities.recognizers.blinkid.CombinedRecognizer
CLASS_NAMEFields inherited from interface com.microblink.blinkcard.entities.recognizers.blinkid.imageoptions.encode.EncodeFullDocumentImagesOptions
CLASS_NAMEFields inherited from interface com.microblink.blinkcard.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 settings which control the anonymization of returned data.Getter for combined result which is associated with this combined recognizer.intReturns the DPI (Dots Per Inch) for full document image that should be returned.Returns the extension factors for full document image.floatThis parameter is used to adjust heuristics that eliminate cases when the hand is present in the input but it is not holding the document.floatHand scale is calculated as a ratio between area of hand mask and document mask.floatMinimum required distance between the edge of the scanning frame and the document.Photocopy analysis match level - higher is stricter.Screen analysis match level - higher is stricter.The level of allowed detected tilt of the document in the image.protected voidreadFromParcel(android.os.Parcel in) protected byte[]voidsetAllowBlurFilter(boolean allowBlurFilter) Skip processing of the blurred frames.voidsetAllowInvalidCardNumber(boolean allowInvalidCardNumber) Whether invalid card number is accepted.voidsetAnonymizationSettings(BlinkCardAnonymizationSettings anonymizationSettings) Sets the settings which control the anonymization of returned data.voidsetEncodeFullDocumentImage(boolean encodeFullDocumentImage) Sets whether full document image should be encoded in JPEG format and written into the corresponding recognition result.voidsetExtractCvv(boolean extractCvv) Should extract the card CVV By default, this is set to 'true'voidsetExtractExpiryDate(boolean extractExpiryDate) Should extract the payment card's expiry date.voidsetExtractIban(boolean extractIban) Should extract the card IBAN By default, this is set to 'true'voidsetExtractOwner(boolean extractOwner) Should extract the card owner information By default, this is set to 'true'voidsetFullDocumentImageDpi(int desiredDPI) Sets desired DPI (Dots Per Inch) for full document image that should be returned.voidsetFullDocumentImageExtensionFactors(ImageExtensionFactors fullDocumentImageExtensionFactors) Sets extension factors for full document image.voidsetHandDocumentOverlapThreshold(float handDocumentOverlapThreshold) This parameter is used to adjust heuristics that eliminate cases when the hand is present in the input but it is not holding the document.voidsetHandScaleThreshold(float handScaleThreshold) Hand scale is calculated as a ratio between area of hand mask and document mask.voidsetLivenessStatusCallback(LivenessStatusCallback livenessStatusCallback) Sets theLivenessStatusCallbackthat will receive liveness status.voidsetPaddingEdge(float paddingEdge) Minimum required distance between the edge of the scanning frame and the document.voidsetPhotocopyAnalysisMatchLevel(MatchLevel photocopyAnalysisMatchLevel) Photocopy analysis match level - higher is stricter.voidsetReturnFullDocumentImage(boolean returnFullDocumentImage) Sets whether full document image should be available inFullDocumentImageResult.voidsetScreenAnalysisMatchLevel(MatchLevel screenAnalysisMatchLevel) Screen analysis match level - higher is stricter.voidsetTiltDetectionLevel(DetectionLevel tiltDetectionLevel) The level of allowed detected tilt of the document in the image.booleanSkip processing of the blurred frames.booleanWhether invalid card number is accepted.booleanReturns whether encoding of full document images and writing them into the recognition result is enabled.booleanShould extract the card CVV By default, this is set to 'true'booleanShould extract the payment card's expiry date.booleanShould extract the card IBAN By default, this is set to 'true'booleanShould extract the card owner information By default, this is set to 'true'booleanReturns whether full document image will be available inFullDocumentImageResult.protected voidterminateNative(long nativeContext) voidwriteToParcel(android.os.Parcel dest, int flags) Methods inherited from class com.microblink.blinkcard.entities.recognizers.Recognizer
getName, isExcludedFromPing, requiresAutofocus, requiresLandscapeModeMethods inherited from class com.microblink.blinkcard.entities.Entity
describeContents, finalize, getNativeContext, getResult, nativeGetNativeResultContext
-
Field Details
-
CREATOR
-
-
Constructor Details
-
BlinkCardRecognizer
public BlinkCardRecognizer()
-
-
Method Details
-
setAllowInvalidCardNumber
public void setAllowInvalidCardNumber(boolean allowInvalidCardNumber) Whether invalid card number is accepted. By default, this is set to 'false' -
shouldAllowInvalidCardNumber
public boolean shouldAllowInvalidCardNumber()Whether invalid card number is accepted. By default, this is set to 'false' -
setTiltDetectionLevel
The level of allowed detected tilt of the document in the image. Defines the severity of allowed detected tilt of the document in the image, as defined inDetectionLevel. Values range from `Off` (detection turned off) to higher levels of allowed tilt. By default, this is set to 'Mid'. -
getTiltDetectionLevel
The level of allowed detected tilt of the document in the image. Defines the severity of allowed detected tilt of the document in the image, as defined inDetectionLevel. Values range from `Off` (detection turned off) to higher levels of allowed tilt. By default, this is set to 'Mid'. -
setHandScaleThreshold
public void setHandScaleThreshold(@FloatRange(from=0.0,to=1.0) float handScaleThreshold) Hand scale is calculated as a ratio between area of hand mask and document mask. `handScaleThreshold` is the minimal value for hand to be accepted as significant. By default, this is set to '0.15'. -
getHandScaleThreshold
@FloatRange(from=0.0, to=1.0) public float getHandScaleThreshold()Hand scale is calculated as a ratio between area of hand mask and document mask. `handScaleThreshold` is the minimal value for hand to be accepted as significant. By default, this is set to '0.15'. -
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.blinkcard.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.
-
setExtractIban
public void setExtractIban(boolean extractIban) Should extract the card IBAN By default, this is set to 'true' -
shouldExtractIban
public boolean shouldExtractIban()Should extract the card IBAN By default, this is set to 'true' -
setExtractCvv
public void setExtractCvv(boolean extractCvv) Should extract the card CVV By default, this is set to 'true' -
shouldExtractCvv
public boolean shouldExtractCvv()Should extract the card CVV By default, this is set to 'true' -
setHandDocumentOverlapThreshold
public void setHandDocumentOverlapThreshold(@FloatRange(from=0.0,to=1.0) float handDocumentOverlapThreshold) This parameter is used to adjust heuristics that eliminate cases when the hand is present in the input but it is not holding the document. `handDocumentOverlapThreshold` is the minimal ratio of hand pixels inside the frame surrounding the document and area of that frame. Only pixels inside that frame are used to ignore false-positive hand segmentations inside the document (e.g. profile photo on documents) By default, this is set to '0.05'. -
getHandDocumentOverlapThreshold
@FloatRange(from=0.0, to=1.0) public float getHandDocumentOverlapThreshold()This parameter is used to adjust heuristics that eliminate cases when the hand is present in the input but it is not holding the document. `handDocumentOverlapThreshold` is the minimal ratio of hand pixels inside the frame surrounding the document and area of that frame. Only pixels inside that frame are used to ignore false-positive hand segmentations inside the document (e.g. profile photo on documents) By default, this is set to '0.05'. -
setPaddingEdge
public void setPaddingEdge(@FloatRange(from=0.0,to=1.0) float paddingEdge) Minimum required distance between the edge of the scanning frame and the document. Defined as a percentage of the frame width. By default, this is set to '0.0' in which case the padding edge and the image edge are the same. Alternative recommended value is 0.02f. -
getPaddingEdge
@FloatRange(from=0.0, to=1.0) public float getPaddingEdge()Minimum required distance between the edge of the scanning frame and the document. Defined as a percentage of the frame width. By default, this is set to '0.0' in which case the padding edge and the image edge are the same. Alternative recommended value is 0.02f. -
setScreenAnalysisMatchLevel
Screen analysis match level - higher is stricter. By default, this is set to 'Level5'. -
getScreenAnalysisMatchLevel
Screen analysis match level - higher is stricter. By default, this is set to 'Level5'. -
setExtractExpiryDate
public void setExtractExpiryDate(boolean extractExpiryDate) Should extract the payment card's expiry date. By default, this is set to 'true' -
shouldExtractExpiryDate
public boolean shouldExtractExpiryDate()Should extract the payment card's expiry date. By default, this is set to 'true' -
setAllowBlurFilter
public void setAllowBlurFilter(boolean allowBlurFilter) Skip processing of the blurred frames. By default, this is set to 'true' -
shouldAllowBlurFilter
public boolean shouldAllowBlurFilter()Skip processing of the blurred frames. By default, this is set to 'true' -
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.blinkcard.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.
-
setExtractOwner
public void setExtractOwner(boolean extractOwner) Should extract the card owner information By default, this is set to 'true' -
shouldExtractOwner
public boolean shouldExtractOwner()Should extract the card owner information By default, this is set to 'true' -
setPhotocopyAnalysisMatchLevel
Photocopy analysis match level - higher is stricter. By default, this is set to 'Level5'. -
getPhotocopyAnalysisMatchLevel
Photocopy analysis match level - higher is stricter. By default, this is set to 'Level5'. -
getFullDocumentImageDpi
public int getFullDocumentImageDpi()Returns the DPI (Dots Per Inch) for full document image that should be returned. By default, this is set to '250'.- Specified by:
getFullDocumentImageDpiin interfaceFullDocumentImageDpiOptions- Returns:
- DPI for full document image that should be returned.
-
setFullDocumentImageDpi
public void setFullDocumentImageDpi(@IntRange(from=100L,to=400L) int desiredDPI) Sets desired DPI (Dots Per Inch) for full document image that should be returned. By default, this is set to '250'.- Specified by:
setFullDocumentImageDpiin interfaceFullDocumentImageDpiOptions- Parameters:
desiredDPI- desired DPI in range [100, 400]
-
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.
-
setAnonymizationSettings
Sets the settings which control the anonymization of returned data. -
getAnonymizationSettings
Returns the settings which control the anonymization of returned data. By default, this is set to '[0, 0, 0, 0, 0, 0, 0]'. -
getCombinedResult
Getter for combined result which is associated with this combined recognizer.- Specified by:
getCombinedResultin interfaceCombinedRecognizer- Returns:
- combined result which is associated with this combined recognizer.
-
setLivenessStatusCallback
Sets theLivenessStatusCallbackthat will receive liveness status.- Parameters:
livenessStatusCallback-LivenessStatusCallbackthat will receive liveness status.
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcelin interfaceandroid.os.Parcelable- Overrides:
writeToParcelin classEntity<BlinkCardRecognizer.Result>
-
readFromParcel
protected void readFromParcel(@NonNull android.os.Parcel in) - Overrides:
readFromParcelin classEntity<BlinkCardRecognizer.Result>
-
terminateNative
protected void terminateNative(long nativeContext) - Specified by:
terminateNativein classEntity<BlinkCardRecognizer.Result>
-
serializeNativeSettings
@Nullable protected byte[] serializeNativeSettings()- Specified by:
serializeNativeSettingsin classEntity<BlinkCardRecognizer.Result>
-
deserializeNativeSettings
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings) - Specified by:
deserializeNativeSettingsin classEntity<BlinkCardRecognizer.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<BlinkCardRecognizer.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<BlinkCardRecognizer.Result>- Parameters:
other- Entity from which result should be consumed.
-