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
-
Field Summary
Fields inherited from interface com.microblink.blinkcard.entities.recognizers.blinkid.CombinedRecognizer
CLASS_NAME
Fields inherited from interface com.microblink.blinkcard.entities.recognizers.blinkid.imageoptions.encode.EncodeFullDocumentImagesOptions
CLASS_NAME
Fields inherited from interface com.microblink.blinkcard.entities.recognizers.blinkid.imageoptions.FullDocumentImageOptions
CLASS_NAME
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Create a copy of the entity.void
consumeResultFrom
(Entity other) Consume result from other entity.protected void
deserializeNativeSettings
(byte[] serializedSettings) Returns the settings which control the anonymization of returned data.Getter for combined result which is associated with this combined recognizer.int
Returns the DPI (Dots Per Inch) for full document image that should be returned.Returns the extension factors for full document image.float
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.float
Hand scale is calculated as a ratio between area of hand mask and document mask.float
Minimum 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.protected void
readFromParcel
(android.os.Parcel in) protected byte[]
void
setAllowBlurFilter
(boolean allowBlurFilter) Skip processing of the blurred frames.void
setAllowInvalidCardNumber
(boolean allowInvalidCardNumber) Whether invalid card number is accepted.void
setAnonymizationSettings
(BlinkCardAnonymizationSettings anonymizationSettings) Sets the settings which control the anonymization of returned data.void
setEncodeFullDocumentImage
(boolean encodeFullDocumentImage) Sets whether full document image should be encoded in JPEG format and written into the corresponding recognition result.void
setExtractCvv
(boolean extractCvv) Should extract the card CVV By default, this is set to 'true'void
setExtractExpiryDate
(boolean extractExpiryDate) Should extract the payment card's expiry date.void
setExtractIban
(boolean extractIban) Should extract the card IBAN By default, this is set to 'true'void
setExtractOwner
(boolean extractOwner) Should extract the card owner information By default, this is set to 'true'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
setHandDocumentOverlapThreshold
(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.void
setHandScaleThreshold
(float handScaleThreshold) Hand scale is calculated as a ratio between area of hand mask and document mask.void
setLivenessStatusCallback
(LivenessStatusCallback livenessStatusCallback) Sets theLivenessStatusCallback
that will receive liveness status.void
setPaddingEdge
(float paddingEdge) Minimum required distance between the edge of the scanning frame and the document.void
setPhotocopyAnalysisMatchLevel
(MatchLevel photocopyAnalysisMatchLevel) Photocopy analysis match level - higher is stricter.void
setReturnFullDocumentImage
(boolean returnFullDocumentImage) Sets whether full document image should be available inFullDocumentImageResult
.void
setScreenAnalysisMatchLevel
(MatchLevel screenAnalysisMatchLevel) Screen analysis match level - higher is stricter.boolean
Skip processing of the blurred frames.boolean
Whether invalid card number is accepted.boolean
Returns whether encoding of full document images and writing them into the recognition result is enabled.boolean
Should extract the card CVV By default, this is set to 'true'boolean
Should extract the payment card's expiry date.boolean
Should extract the card IBAN By default, this is set to 'true'boolean
Should extract the card owner information By default, this is set to 'true'boolean
Returns whether full document image will be available inFullDocumentImageResult
.protected void
terminateNative
(long nativeContext) void
writeToParcel
(android.os.Parcel dest, int flags) Methods inherited from class com.microblink.blinkcard.entities.recognizers.Recognizer
getName, isExcludedFromPing, requiresAutofocus, requiresLandscapeMode
Methods 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' -
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:EncodeFullDocumentImagesOptions
Sets 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.STANDARD
recognizer which contains encoded image cannot be parcelized and passed byIntent
extras 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.OPTIMISED
orIntentDataTransferMode.PERSISTED_OPTIMISED
- Specified by:
setEncodeFullDocumentImage
in 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:EncodeFullDocumentImagesOptions
Returns whether encoding of full document images and writing them into the recognition result is enabled. By default, this is set to 'false'.- Specified by:
shouldEncodeFullDocumentImage
in 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:FullDocumentImageOptions
Sets 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.STANDARD
recognizer which contains encoded image cannot be parcelized and passed byIntent
extras 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.OPTIMISED
orIntentDataTransferMode.PERSISTED_OPTIMISED
By default, this is set to 'false'- Specified by:
setReturnFullDocumentImage
in interfaceFullDocumentImageOptions
- Parameters:
returnFullDocumentImage
- whether full document image will be available inFullDocumentImageResult
.
-
shouldReturnFullDocumentImage
public boolean shouldReturnFullDocumentImage()Description copied from interface:FullDocumentImageOptions
Returns whether full document image will be available inFullDocumentImageResult
. By default, this is set to 'false'. By default, this is set to 'false'- Specified by:
shouldReturnFullDocumentImage
in 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:
getFullDocumentImageDpi
in 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:
setFullDocumentImageDpi
in 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:
setFullDocumentImageExtensionFactors
in 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:
getFullDocumentImageExtensionFactors
in 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:
getCombinedResult
in interfaceCombinedRecognizer
- Returns:
- combined result which is associated with this combined recognizer.
-
setLivenessStatusCallback
Sets theLivenessStatusCallback
that will receive liveness status.- Parameters:
livenessStatusCallback
-LivenessStatusCallback
that will receive liveness status.
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) - Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Overrides:
writeToParcel
in classEntity<BlinkCardRecognizer.Result>
-
readFromParcel
protected void readFromParcel(@NonNull android.os.Parcel in) - Overrides:
readFromParcel
in classEntity<BlinkCardRecognizer.Result>
-
terminateNative
protected void terminateNative(long nativeContext) - Specified by:
terminateNative
in classEntity<BlinkCardRecognizer.Result>
-
serializeNativeSettings
@Nullable protected byte[] serializeNativeSettings()- Specified by:
serializeNativeSettings
in classEntity<BlinkCardRecognizer.Result>
-
deserializeNativeSettings
protected void deserializeNativeSettings(@NonNull byte[] serializedSettings) - Specified by:
deserializeNativeSettings
in classEntity<BlinkCardRecognizer.Result>
-
clone
Description copied from class:Entity
Create 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 theRecognizerRunnerView
orRecognizerRunner
with the updated entity hierarchy.- Specified by:
clone
in classRecognizer<BlinkCardRecognizer.Result>
- Returns:
- a copy of the entity
-
consumeResultFrom
Description copied from class:Entity
Consume 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:
consumeResultFrom
in classEntity<BlinkCardRecognizer.Result>
- Parameters:
other
- Entity from which result should be consumed.
-