Class BlinkCardRecognizer

All Implemented Interfaces:
android.os.Parcelable, CombinedRecognizer, FullDocumentImageDpiOptions, EncodeFullDocumentImagesOptions, FullDocumentImageExtensionOptions, FullDocumentImageOptions

Recognizer used for scanning both sides of payment cards.
  • Field Details

  • 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 set MicroblinkSDK.setIntentDataTransferMode(com.microblink.blinkcard.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
      Specified by:
      setEncodeFullDocumentImage in interface EncodeFullDocumentImagesOptions
      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 interface EncodeFullDocumentImagesOptions
      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

      public void setScreenAnalysisMatchLevel(@NonNull MatchLevel screenAnalysisMatchLevel)
      Screen analysis match level - higher is stricter. By default, this is set to 'Level5'.
    • getScreenAnalysisMatchLevel

      @NonNull public MatchLevel 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 in FullDocumentImageResult. If enabled, get image using FullDocumentImageResult.getFullDocumentImage() By default, this is set to 'false'. IMPORTANT NOTE: If you set MicroblinkSDK.setIntentDataTransferMode(com.microblink.blinkcard.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'
      Specified by:
      setReturnFullDocumentImage in interface FullDocumentImageOptions
      Parameters:
      returnFullDocumentImage - whether full document image will be available in FullDocumentImageResult.
    • shouldReturnFullDocumentImage

      public boolean shouldReturnFullDocumentImage()
      Description copied from interface: FullDocumentImageOptions
      Returns whether full document image will be available in FullDocumentImageResult. By default, this is set to 'false'. By default, this is set to 'false'
      Specified by:
      shouldReturnFullDocumentImage in interface FullDocumentImageOptions
      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

      public void setPhotocopyAnalysisMatchLevel(@NonNull MatchLevel photocopyAnalysisMatchLevel)
      Photocopy analysis match level - higher is stricter. By default, this is set to 'Level5'.
    • getPhotocopyAnalysisMatchLevel

      @NonNull public MatchLevel 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 interface FullDocumentImageDpiOptions
      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 interface FullDocumentImageDpiOptions
      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 interface FullDocumentImageExtensionOptions
      Parameters:
      fullDocumentImageExtensionFactors - extension factors for full document image.
    • getFullDocumentImageExtensionFactors

      @NonNull public ImageExtensionFactors 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 interface FullDocumentImageExtensionOptions
      Returns:
      extension factors for full document image.
    • setAnonymizationSettings

      public void setAnonymizationSettings(BlinkCardAnonymizationSettings anonymizationSettings)
      Sets the settings which control the anonymization of returned data.
    • getAnonymizationSettings

      @NonNull public BlinkCardAnonymizationSettings 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

      @Nullable public CombinedResult getCombinedResult()
      Getter for combined result which is associated with this combined recognizer.
      Specified by:
      getCombinedResult in interface CombinedRecognizer
      Returns:
      combined result which is associated with this combined recognizer.
    • setLivenessStatusCallback

      public void setLivenessStatusCallback(@Nullable LivenessStatusCallback livenessStatusCallback)
      Sets the LivenessStatusCallback 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 interface android.os.Parcelable
      Overrides:
      writeToParcel in class Entity<BlinkCardRecognizer.Result>
    • readFromParcel

      protected void readFromParcel(@NonNull android.os.Parcel in)
      Overrides:
      readFromParcel in class Entity<BlinkCardRecognizer.Result>
    • terminateNative

      protected void terminateNative(long nativeContext)
      Specified by:
      terminateNative in class Entity<BlinkCardRecognizer.Result>
    • serializeNativeSettings

      @Nullable protected byte[] serializeNativeSettings()
      Specified by:
      serializeNativeSettings in class Entity<BlinkCardRecognizer.Result>
    • deserializeNativeSettings

      protected void deserializeNativeSettings(@NonNull byte[] serializedSettings)
      Specified by:
      deserializeNativeSettings in class Entity<BlinkCardRecognizer.Result>
    • clone

      public BlinkCardRecognizer 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 the RecognizerRunnerView or RecognizerRunner with the updated entity hierarchy.
      Specified by:
      clone in class Recognizer<BlinkCardRecognizer.Result>
      Returns:
      a copy of the entity
    • consumeResultFrom

      public void consumeResultFrom(@NonNull Entity other)
      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 inside BaseIntentTransferable.loadFromIntent(Intent) and similar methods to replace the result content of the saved entities with results that have arrived over Intent
      Specified by:
      consumeResultFrom in class Entity<BlinkCardRecognizer.Result>
      Parameters:
      other - Entity from which result should be consumed.