eu.id3.document

## Class MrzReader

- java.lang.Object
- - eu.id3.document.MrzReader

- All Implemented Interfaces:
    java.io.Serializable, java.lang.AutoCloseable

      public class MrzReader
      extends java.lang.Object
      implements java.lang.AutoCloseable, java.io.Serializable

  Detects and reads an MRZ in an image.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MrzReader()` Creates a new instance of the MrzReader class.
    `MrzReader(long handle)` Creates a new instance of the MrzReader class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Releases all resources used by this MrzReader.
    `protected void` | `finalize()` Finalizer for this class.
    `int` | `getBinarizationMethod()` Gets the selection of the binarization method internally used in the algorithm.
    `long` | `getHandle()` Gets the native handle.
    `DocumentModel` | `getModel()` Gets the AI model used to detect the MRZ.
    `ProcessingUnit` | `getProcessingUnit()` Gets the processing unit where to run the detection process.
    `int` | `getThreadCount()` Gets the number of threads to use for reading.
    `MrzReadingResult` | `readMrz(DocumentImage image)` Detects and reads an MRZ in an image.
    `void` | `setBinarizationMethod(int binarizationMethod)` Sets the selection of the binarization method internally used in the algorithm.
    `void` | `setModel(DocumentModel model)` Sets the AI model used to detect the MRZ.
    `void` | `setProcessingUnit(ProcessingUnit processingUnit)` Sets the processing unit where to run the detection process.
    `void` | `setThreadCount(int threadCount)` Sets the number of threads to use for reading.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MrzReader

          public MrzReader()
                    throws DocumentException

      Creates a new instance of the MrzReader class.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### MrzReader

          public MrzReader(long handle)
                    throws DocumentException

      Creates a new instance of the MrzReader class.
      Parameters:
        `handle` - Handle to the MrzReader.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

  - ### Method Detail

    - #### close

          public void close()

      Releases all resources used by this MrzReader.
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

    - #### finalize

          protected void finalize()

      Finalizer for this class. Finalizers are deprecated since Java 9+. This method is not guaranteed to be called. To release all memory held by this class please be sure to call the close() method.
      Overrides:
        `finalize` in class `java.lang.Object`

    - #### getHandle

          public long getHandle()

      Gets the native handle.
      Returns:
        The native handle.

    - #### getBinarizationMethod

          public int getBinarizationMethod()
                                    throws DocumentException

      Gets the selection of the binarization method internally used in the algorithm.
      Returns:
        Selection of the binarization method internally used in the algorithm.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### setBinarizationMethod

          public void setBinarizationMethod(int binarizationMethod)
                                     throws DocumentException

      Sets the selection of the binarization method internally used in the algorithm.
      Parameters:
        `binarizationMethod` - Selection of the binarization method internally used in the algorithm.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### getModel

          public DocumentModel getModel()
                                 throws DocumentException

      Gets the AI model used to detect the MRZ. Hint: Default value is MrzDetector2A.
      Returns:
        AI model used to detect the MRZ.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### setModel

          public void setModel(DocumentModel model)
                        throws DocumentException

      Sets the AI model used to detect the MRZ. Hint: Default value is MrzDetector2A.
      Parameters:
        `model` - AI model used to detect the MRZ.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### getProcessingUnit

          public ProcessingUnit getProcessingUnit()
                                           throws DocumentException

      Gets the processing unit where to run the detection process. Hint: Default value is CPU.
      Returns:
        Processing unit where to run the detection process.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### setProcessingUnit

          public void setProcessingUnit(ProcessingUnit processingUnit)
                                 throws DocumentException

      Sets the processing unit where to run the detection process. Hint: Default value is CPU.
      Parameters:
        `processingUnit` - Processing unit where to run the detection process.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### getThreadCount

          public int getThreadCount()
                             throws DocumentException

      Gets the number of threads to use for reading. Hint: Default value is 1. Allocating more than 1 thread here can increase the speed of the process.
      Returns:
        Number of threads to use for reading.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### setThreadCount

          public void setThreadCount(int threadCount)
                              throws DocumentException

      Sets the number of threads to use for reading. Hint: Default value is 1. Allocating more than 1 thread here can increase the speed of the process.
      Parameters:
        `threadCount` - Number of threads to use for reading.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

    - #### readMrz

          public MrzReadingResult readMrz(DocumentImage image)
                                   throws DocumentException

      Detects and reads an MRZ in an image.
      Parameters:
        `image` - Source image to process
      Returns:
        MRZ reading output.
      Throws:
        `DocumentException` - An error has occurred during Document Library execution.

Copyright © 2020-2030, id3 Technologies. All rights reserved. eu.id3.document