All Implemented Interfaces:
android.os.Parcelable

public final class MRTDDetector extends QuadWithSizeDetector<MRTDDetector.Result>
Detector that can perform detection of Machine Readable Travel Documents (MRTD).
  • Field Details

    • CREATOR

      public static final android.os.Parcelable.Creator<MRTDDetector> CREATOR
  • Constructor Details

    • MRTDDetector

      public MRTDDetector()
  • Method Details

    • setDetectFullDocument

      public void setDetectFullDocument(boolean detectFullDocument)
      Defines whether full document will be detected. If set to false, result will contain location of Machine Readable Zone only. If set to true, result will contain location of entire document. By default, this is set to 'true'
    • isDetectFullDocument

      public boolean isDetectFullDocument()
      Defines whether full document will be detected. If set to false, result will contain location of Machine Readable Zone only. If set to true, result will contain location of entire document. By default, this is set to 'true'
    • setUseCardDetector

      public void setUseCardDetector(boolean useCardDetector)
      Enable detection correction with card detector. When this option is enabled, after MRTD detector has found the document, it will internally use DocumentDetector to additionally correct document location estimated from detected MRZ location. Note that although enabling this option will usually improve detection accuracy, it may be possible that for some use cases accuracy will be lower. By default, this is set to 'false'
    • isUseCardDetector

      public boolean isUseCardDetector()
      Enable detection correction with card detector. When this option is enabled, after MRTD detector has found the document, it will internally use DocumentDetector to additionally correct document location estimated from detected MRZ location. Note that although enabling this option will usually improve detection accuracy, it may be possible that for some use cases accuracy will be lower. By default, this is set to 'false'
    • setSpecifications

      public void setSpecifications(@Nullable @Size(min=1L) MrtdSpecification... specifications)
      Sets one or more MrtdSpecification objects that will define which MRTD documents should be detectable. Setting null or empty array will enable all possible specifications.
      Parameters:
      specifications - specifications for MRTD documents that should be detectable
    • getSpecifications

      @NonNull public MrtdSpecification[] getSpecifications()
      Returns the array of MrtdSpecification objects that will define which MRTD documents should be detectable.
      Returns:
      the array of MrtdSpecification objects that will define which MRTD documents should be detectable.
    • terminateNative

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

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

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

      public MRTDDetector 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 Entity<MRTDDetector.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<MRTDDetector.Result>
      Parameters:
      other - Entity from which result should be consumed.