.. index:: 
  !MrzReader Class

.. _id3_document_mrz_reader_class:

===============================================================================
MrzReader Class
===============================================================================

Namespace: :ref:`id3.Document<reference_document>`

.. toctree::
  :hidden:

  binarizationMethod<binarization_method>
  model<model>
  processingUnit<processing_unit>
  readMrz<read_mrz>
  threadCount<thread_count>


Definition
----------
.. line-block::
    Detects and reads an MRZ in an image.

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        class MrzReader

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        class MrzReader implements Finalizable

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public partial class MrzReader

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public class MrzReader implements AutoCloseable, Serializable

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public class MrzReader

    .. tab-item:: C
      :sync: C

      .. code:: C

        typedef struct id3DocumentMrzReader *ID3_DOCUMENT_MRZ_READER;



Usage
-----

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        mrzReaderInstance = MrzReader()
        # ...

      **Explicit destruction**

      .. code:: Python

        # ...
        del mrzReaderInstance

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        final mrzReaderInstance = sdk.MrzReader();
        // ...

      **Explicit destruction**

      .. code:: Dart

        // ...
        mrzReaderInstance.dispose()

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        using (var mrzReaderInstance = new MrzReader())
        {
           // ...
        }

      **Explicit destruction**

      .. code:: C#

        var mrzReaderInstance = new MrzReader()
        // ...
        mrzReaderInstance.Dispose()

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        try (MrzReader mrzReaderInstance = new MrzReader()) {
        // ...
        }

      **Explicit destruction**

      .. code:: Java

        MrzReader mrzReaderInstance = new MrzReader();
        // ...
        mrzReaderInstance.close();

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        private var mrzReaderInstance: MrzReader? = nil
        mrzReaderInstance = try MrzReader()

    .. tab-item:: C
      :sync: C

      .. code:: C

        ID3_DOCUMENT_MRZ_READER hMrzReader{};
        int err = id3DocumentMrzReader_Initialize(&hMrzReader);
        if (err == ID3_SUCCESS) {
            // ...
            id3DocumentMrzReader_Dispose(&hMrzReader);
        }


Properties
----------

.. list-table:: 
  :width: 100%
  :widths: 30 5 65
  :header-rows: 1

  * - Name
    - Type
    - Description
  * - :ref:`binarizationMethod<id3_document_mrz_reader_binarization_method_class_member>`
    - int
    - Selection of the binarization method internally used in the algorithm.
  * - :ref:`model<id3_document_mrz_reader_model_class_member>`
    - :ref:`DocumentModel<id3_document_document_model_enum>`
    - AI model used to detect the MRZ.
  * - :ref:`processingUnit<id3_document_mrz_reader_processing_unit_class_member>`
    - :ref:`ProcessingUnit<id3_document_processing_unit_enum>`
    - Processing unit where to run the detection process.
  * - :ref:`threadCount<id3_document_mrz_reader_thread_count_class_member>`
    - int
    - Number of threads to use for reading.

Methods
-------

.. list-table:: 
  :width: 100%
  :widths: 30 70
  :header-rows: 1

  * - Name
    - Description
  * - :ref:`readMrz<id3_document_mrz_reader_read_mrz_class_method>`
    - Detects and reads an MRZ in an image.
