<a id="mxc2-using"></a>

# Using EasyMatrixCode

This document details all the capabilities of **EasyMatrixCode** beyond calling [`EMatrixCodeReader::Read()`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) on an image.

<a id="mxc2-read-parameters"></a>

## Read Parameters

Tune the following parameters to optimize the performance of **EasyMatrixCode**.

* The [`EMatrixCodeReader::SetMaxNumCodes`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a4cd37bdc11e18ec343370b260c9afcaa) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a34aa5cec2d24b4a5f7d4d6d8a0726dc1) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aff01c9c7974d97f58b21720acb57e230) parameter:
  * Tells the [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) the number of codes that can be in the image.

#### WARNING
Be aware that setting `MaxNumCodes` to a value bigger than the number of codes in big images can make **EasyMatrixCode** slow, as it will keep trying to find codes that do not exist in the image.

* The [`EMatrixCodeReader::SetTimeOut`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aeb83f7b34e87c24bc35fa6e4d8f40cab) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a77febfb4cbce1175488780086d237a49) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ac3bbfff41d8a1c0d64445ec41c73acda) parameter:
  * Limits the amount of time that the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) and [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) methods may take to process a single image.
  * Is defined in microseconds.
  * Is set, by default, to a value that exceeds one hour.
* The [`EMatrixCodeReader::SetReadMode`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad2d344b9eb600b26c6e39f0713ce3b4b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a44c14366380ce39160d3a0ce11eca803) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a00a20a3a600b7ee2be591f8ff2a8972f) parameter affects the behavior of the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method:
  * The setting [`Speed`](../../../doxygen_cpp/namespaceeVision_1_1EasyMatrixCode2.html#ad0a505ad26f3b978fe8a74a6002a52a4ae3b7110de0460fa78a9134e282c31ace) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision_1_1EasyMatrixCode2.html#a288650a443b070a0be95d6c496efa2a1) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EReadMode.html#a684f7c85c830bdc9a18ae8a01bef0e73) results in the shortest processing times and the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method stops as soon as one of the following is true:
    * The method has found [`EMatrixCodeReader::SetMaxNumCodes`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a4cd37bdc11e18ec343370b260c9afcaa) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a34aa5cec2d24b4a5f7d4d6d8a0726dc1) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aff01c9c7974d97f58b21720acb57e230) codes.
    * The method reaches the [`EMatrixCodeReader::SetTimeOut`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aeb83f7b34e87c24bc35fa6e4d8f40cab) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a77febfb4cbce1175488780086d237a49) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ac3bbfff41d8a1c0d64445ec41c73acda) time limit.
    * The [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) process is completely finished.
  * The setting [`Quality`](../../../doxygen_cpp/namespaceeVision_1_1EasyMatrixCode2.html#ad0a505ad26f3b978fe8a74a6002a52a4a549add72cc257a4b177db44275d57219) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision_1_1EasyMatrixCode2.html#a288650a443b070a0be95d6c496efa2a1) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EReadMode.html#a46a819b660ff1939dc0715eb025b4f0e) results in the best grading results and the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method keeps trying to improve its detection until one of the following is true:
    * The method reaches the [`EMatrixCodeReader::SetTimeOut`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aeb83f7b34e87c24bc35fa6e4d8f40cab) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a77febfb4cbce1175488780086d237a49) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ac3bbfff41d8a1c0d64445ec41c73acda) time limit.
    * The [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) process is completely finished.
* The [`EMatrixCodeReader::SetComputeGrading`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a8ac394465c23f8753645bd424249e99e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a76af19d73e9661ecf7baf3a647634679) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a1ae81dddeb231d8c614528ee661e4284) parameter:
  * Determines if the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method computes the grading properties of the [`EMatrixCode`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) object.
  * Is set to `false` by default.
* The [`EMatrixCodeReader::SetMatrixCodeDimensionsRange`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a5b2fbd55cada5d66a7f77b33a51f6e34) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aaad7b9717b3b173b82b5dbc1bac639dc) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a5bb83b7ccec4c952d1caa9cda2a7cc4d) parameter:
  * Sets the range of valid lengths in pixels that the sides of the data matrices must satisfy to be detected.
  * You can also use this parameter to extend the reading capability to codes relatively small compared to the input image.
  * This is an advanced parameter, it is harder to tune than the other ones.

After the tuning:

* Use the [`EMatrixCodeReader::Save`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a98d28f520d0b74e231385ef74e999476) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a3e177897fc9dd0f6ccfd88fa5f7ba8d2) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a92e0113d26bf3207baaa6e1e3c876513) method to store the state of the [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) on the disk.
* Use the [`EMatrixCodeReader::Load`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aa7b28905cbddface6d48160e8ce4bc3e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6e05cf1f7b9959089265bcb08620bc9c) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ab6c090f36c95aca47518bdb89204224c) method, at any time, to restore the saved state.

#### NOTE
The [`EMatrixCodeReader::Save`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a98d28f520d0b74e231385ef74e999476) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a3e177897fc9dd0f6ccfd88fa5f7ba8d2) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a92e0113d26bf3207baaa6e1e3c876513) and [`EMatrixCodeReader::Load`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aa7b28905cbddface6d48160e8ce4bc3e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6e05cf1f7b9959089265bcb08620bc9c) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ab6c090f36c95aca47518bdb89204224c) methods also store the effects of [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) (see [below]()).

<a id="mxc2-ematrixcode-contents"></a>

## Contents of the `EMatrixCode` Object

When a data matrix code is read from an image, the [`EMatrixCode`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) object contains the following information:

* The [`decoded string`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a57f1437adadef93d74a5c93191564a3d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a10faca778b3ddcc1fe29f5a2f74e9d40) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ae7719ab402a6994cc374c8d901bab2b6) of the data matrix.
* The [`codewords`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a3da9ad133bf57c90beb95557daebf5de) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ac5fe253adf3dd92667ed5ccfb6a1424a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a6e30c688ea3529b0c136ddfc948b3058) of the data matrix.
* The [`position`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a4425e52d0bc4ec3d3425ca730998501e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a85205f186f5f9bebb0fb9595338b5442) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a46631e0c9261047f800182c328637aa2)  of the data matrix in the image.
* The logical [`width`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#adf5c8c98bed34229c3584c5b77424d01) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#aa06b9d00ec9bce1a46db159af7f91d04) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a9e32e40118c74dcc76dbcc50848f3521) and [`height`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a2ebd803a158977fd927b55fe0ac8c1ab) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a41400f503d833e48789e7123f76d572d) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a178bec0d54206e424ed820a678c528df) of the data matrix.
* The encoding type ([`IsECC200`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a26c87a7c56f30b1c0823e530a0ae96a7) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a284a27905cdf9b0d335fa80c27587b01) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a3ad1c9dbe14511aba75683193832c907), [`IsGS1`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a430088d4445a8060eb5c97ceb9df2a9b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a7e05590a377d8e1fb252d7ebcbe17d00) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a0707fba277c0d53a8fd09d5fe517e2cb)) of the data matrix.
* The printing [`polarity`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#aa3415d3a0bfdf098a49cb0e80acaebae) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#acda97151cf2d2c9bff6b691acf198f6f) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ac8fe25559893c3d3d7e81b3c3041c01b) (black on white or white on black) of the data matrix.
* The [`ISO 15415`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a33538fc212dac593d9f1d067b3ddccd0) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a2b5c2c6d5b77178341a3ffb2e1aba374) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a7c25d3627b5dc97bacf5a6ff30a36b1d), [`ISO 29158`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a33b43bdcd435228c8e69c7b1410dd1e6) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a70e93829e848f8dfbb9939359c818462) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ac577513ceebbfa84805c64a5b5735cc1) or [`Semi T10`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a99ccde79693a7694d9a313085314e056) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a458accefe108d5384a9fa4fda9a8a8ba) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a6a2106066fd17599c78cca27b3fee7f7) grading results  of the data matrix (if [`EMatrixCodeReader::SetComputeGrading`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a8ac394465c23f8753645bd424249e99e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a76af19d73e9661ecf7baf3a647634679) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a1ae81dddeb231d8c614528ee661e4284) is `true`).
* The [`reliability score`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ae340c1b72e048df08def366589274e5e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#abf15b85b58a58bb9c52c667bbe65509f) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a70e7f5a188aff5d3b58f587675c6b76c) of the data matrix.
* Methods to draw the data matrix [`position`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#aff1fa770df927f04c37df2bb07c95fd9) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#abe1afa1dfec052a0ba65e377727e7724) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a8084f617e1de13f7789155e459a780c5), [`grid`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a70e6f66bc7722ef346ccec4067097bc2) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ab60e4890fcd698a4b9fa417f154ca46f) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#abd00fbf3ba1479fd04fed1d30bcbbc19), [`errors`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a719c06b1c40f7c5f7198782188a0e0da) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a2b8a32eb46adfd8b308ce94f75b1b74b) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a98fe647b02f7c44b46ed85650174e3b6) and [`decoded string`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ad6d14ec9430992bb31e9735a16b8e6d0) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ae2809e225024a5322cd21cc7bcf21273) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a7b7e218875f114f4a2e56030061e3c08) on the source image.

<a id="mxc2-gs1"></a>

## Using GS1 Data Matrix Codes

**EasyMatrixCode** is able to find and decode GS1-compliant data matrix codes.

The GS1 standard adds semantic identifiers to the contents of a data matrix code. These identifiers are interpreted in an easy and consistent way.

The structure of GS1-compliant content is as follows:

```default
]d2[GS1]{Id1}{Value1}[GS1?]{Id2}{Value2}…
```

where:

* `]d2` is the string identifying a GS1-compliant stream,
* `[GS1]` is the GS1 escape character (`0x1d`),
* `[GS1?]` means that the `[GS1]` escape character is present there if the previous application identifier has a variable size value,
* `{Id}` is an application identifier,
* `{Value}` is the value associated with that identifier.

**Example**:

The string:

```default
]d2[GS1]10GR-1-GNU[GS1]11180112151901012112345
```

is interpreted as follows:

|     |       |     |          |       |     |        |     |        |     |        |
|-----|-------|-----|----------|-------|-----|--------|-----|--------|-----|--------|
| ]d2 | [GS1] | 10  | GR-1-GNU | [GS1] | 11  | 180112 | 15  | 190101 | 21  | 12345  |
|     |       | Id1 | Value1   |       | Id2 | Value2 | Id3 | Value3 | Id4 | Value4 |
* The first Id is 10, this means the first value is the batch / lot number whose size is at most 20 chars.
  * Thus, the product has a batch / lot number of GR-1-GNU.
  * As batch / lot numbers are of a variable size, a separator is required after GR-1-GNU.
* The second Id is 11, this means the second value is the production date which always consists of 6 digits.
  * The product has a production date of 180112 (12 of January 2018).
  * As production dates have a fixed size, no group separator is required after it.
* The third Id is 15, this means the third value is the “best before date” which always consists of 6 digits.
  * The product has a “best before date” of 190101 (1st of January 2019).
  * As “best before dates” have a fixed size, no group separator is required after it.
* The fourth Id is 21, this means the fourth value is the serial number whose size is at most 20 chars.
  * The product has a serial number of 12345.
  * Altough serial numbers are of variable size, 12345 is the last part of the decoded string, so there is no group separator after it.

#### SEE ALSO
For more information, see [https://www.gs1.org/](https://www.gs1.org/)

* Use [`EGs1Translator::GetHumanReadableCode`](../../../doxygen_cpp/classeVision_1_1EGs1Translator.html#a7d8dacd41b6196defa88758d5986c6a4) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGs1Translator.html#a6026434928b11f93ff0c3875d4bab1da) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGs1Translator.html#a1a39a3262b14b78cb3675ec4fd57630b) to get the human-readable version:
  ```default
  (10)GR-1-GNU(11)180112(15)190101(21)12345
  ```

<a id="mxc2-print-quality"></a>

## Computing the Print Quality

To compute the print quality indicators as defined by **BC11**, **ISO 15415**, **ISO/IEC TR 29158** (formerly known as **AIM DPM-1-2006**) and **SEMI T10-0701** standards, retrieve the grades with the [`EMatrixCode::GetIso15415GradingParameters`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a33538fc212dac593d9f1d067b3ddccd0) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a2b5c2c6d5b77178341a3ffb2e1aba374) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a7c25d3627b5dc97bacf5a6ff30a36b1d), [`EMatrixCode::GetIso29158GradingParameters`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a33b43bdcd435228c8e69c7b1410dd1e6) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a70e93829e848f8dfbb9939359c818462) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ac577513ceebbfa84805c64a5b5735cc1) and [`EMatrixCode::GetSemiT10GradingParameters`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a99ccde79693a7694d9a313085314e056) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a458accefe108d5384a9fa4fda9a8a8ba) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a6a2106066fd17599c78cca27b3fee7f7) accessors of the [`EMatrixCode`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html) class.

#### NOTE
The print quality of the matrix codes is computed during the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) operation, only if the [`EMatrixCodeReader::SetComputeGrading`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a8ac394465c23f8753645bd424249e99e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a76af19d73e9661ecf7baf3a647634679) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a1ae81dddeb231d8c614528ee661e4284) parameter is set to `true`.

#### NOTE
Our implementation of **ISO 29158**, a complement to **ISO 15415**, includes only those parameters that are unique or redefined in **ISO 29158**.
For parameters common to both standards, please refer to the corresponding **ISO 15415** `struct` fields.

#### SEE ALSO
For more information on the code grading, see [Code Grading](../code_grading/index.html.md).

<a id="mxc2-learning"></a>

## Learning a Matrix Code

To improve the processing times and to read small codes, learn a matrix code model from representative images as follows:

1. Load the image of the matrix code you want to learn from.
2. Call the [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) method to learn from the image.
3. Repeat with additional images if necessary.
4. Save the [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) state to the disk with the [`EMatrixCodeReader::Save`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a98d28f520d0b74e231385ef74e999476) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a3e177897fc9dd0f6ccfd88fa5f7ba8d2) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a92e0113d26bf3207baaa6e1e3c876513) method.

By default, the [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) method explores the full range of the [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) internal parameters to search for data matrices in any type of context.

* If the learning process finds valid data matrices, the internal parameters that were necessary to find them are enabled, set and ordered in a way meant to improve both reading speed and capability in similar contexts.
* The user-defined advanced parameters ([`EMatrixCodeReader::SetMaxNumCodes`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a4cd37bdc11e18ec343370b260c9afcaa) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a34aa5cec2d24b4a5f7d4d6d8a0726dc1) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aff01c9c7974d97f58b21720acb57e230), [`EMatrixCodeReader::SetTimeOut`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aeb83f7b34e87c24bc35fa6e4d8f40cab) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a77febfb4cbce1175488780086d237a49) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ac3bbfff41d8a1c0d64445ec41c73acda), [`EMatrixCodeReader::SetReadMode`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad2d344b9eb600b26c6e39f0713ce3b4b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a44c14366380ce39160d3a0ce11eca803) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a00a20a3a600b7ee2be591f8ff2a8972f) and [`EMatrixCodeReader::SetComputeGrading`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a8ac394465c23f8753645bd424249e99e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a76af19d73e9661ecf7baf3a647634679) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a1ae81dddeb231d8c614528ee661e4284)) are not affected by the [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) method.
* After setting [`EMatrixCodeReader::SetMatrixCodeDimensionsRange`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a5b2fbd55cada5d66a7f77b33a51f6e34) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aaad7b9717b3b173b82b5dbc1bac639dc) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a5bb83b7ccec4c952d1caa9cda2a7cc4d), a call to [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) or [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) restricts the processing around that range. This can dramatically improve the speed of the process.

  #### NOTE
  However, if you set the property after the learning, the learning is reset and must be redone.
* If the [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) method is not able to detect any code in the image, it throws an exception.

  #### NOTE
  The internal processing structure is not affected in this situation.
* If the [`EMatrixCodeReader::Learn`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a16ae718d855fa29b034acc90a4a91e8d) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad7f62cc9c6197f28b8fba7d22e51d31a) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a17fe173d2a09689daad89170268b61f6) method has been called, all the subsequent images read or learned must have the same dimensions as the one used in the first learn call, otherwise an exception is thrown.

<a id="mxc2-restoring"></a>

### Restoring the State of an EMatrixCodeReader

* To restore a previously saved [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) state, call the [`EMatrixCodeReader::Load`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aa7b28905cbddface6d48160e8ce4bc3e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6e05cf1f7b9959089265bcb08620bc9c) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ab6c090f36c95aca47518bdb89204224c) method.
* To restore the default state of an [`EMatrixCodeReader`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html) instance, call the [`EMatrixCodeReader::ResetLearning`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aa7f104d920910dfedc21509eaab0eb90) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aeb4d216bf0c751a4ceb1f75bab5916cd) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6b58af8ef4616a9ac7f31beb1669e017) method.

<a id="advanced-grid-read"></a>

## Reading Using a Grid

If the codes in the images are arranged in a regular grid-like fashion:

* Use the dedicated method [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) overloads that return [`EMatrixCodeGrid`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html) objects to improve the reliability and the speed of the reading.
* Use the methods [`EGrid::SetEnableCell`](../../../doxygen_cpp/classeVision_1_1EGrid.html#aba771f188948f660da2c0194a9b58a3f) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGrid.html#a1fd0da028d375583b1e88dcce0773be4) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGrid.html#a8b512a41cd91f259e36ecbb171d78865), [`EGrid::SetEnableRow`](../../../doxygen_cpp/classeVision_1_1EGrid.html#a3844f5b8b179aeaf4a2126498caf2f76) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGrid.html#a773b4e6991849b0ecc1ba54fd3cbcacc) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGrid.html#a39048b6eb0c0ffd668612f477c310d76), [`EGrid::SetEnableColumn`](../../../doxygen_cpp/classeVision_1_1EGrid.html#a38b2cd477e372de59eb97368b9e99bb8) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGrid.html#a58a6e9901b3fda53ee457f02a590f049) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGrid.html#a7f3a7e831554b929a05d5aeb4a78f1ee) or [`EGrid::SetEnableAll`](../../../doxygen_cpp/classeVision_1_1EGrid.html#a94d5c95f83523c96f7f3ce4183117803) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGrid.html#af176f6ab91c3a5b439526df7442d0ed6) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGrid.html#a6ab6b2c8a001ead2c95b6c6662ac61dc) to disable the processing of cells that you know do not contain any code.
* Use the method [`EMatrixCodeGrid::GetResults`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html#aa502b07d13cc56860b737329f53c7a73) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html#aa04a45cdf57473b85140d53bb7606a84) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeGrid.html#ae2347ab899624d3aecd762485d5f64c6) of the returned [`EGrid`](../../../doxygen_cpp/classeVision_1_1EGrid.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EGrid.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EGrid.html) object to retrieve the codes read in each cell of the defined grid.

#### SEE ALSO
For an example, see [Reading a Grid of Matrix Codes](../../../resources/code_snippets/text_and_code_reading/easymatrixcode/easymatrixcode2/readingagridofmatrixcodes.html.md)

![](assets/images/easymatrixcode2/grid.webp)

<a id="mxc2-return-unreadable"></a>

## Returning Unreadable Codes

Some codes may have their data part so damaged that they cannot be decoded.

* However, you can set [`EMatrixCodeReader::SetEnableReturnUnreliableCodes`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a08301087108a3d74c29047f8b64dc249) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#afb5c45a89afdca82d76630c52fe20412) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#aba7ad57b4e992f21d41d2a2639450572) to `true` to return them anyway.
  * These codes are placed at the end of the return vector.
  * Calling [`EMatrixCode::GetIsReliable`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a706de90bc8c663a9f0b74513acdd457a) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a1855a125815675da5bf196c39dd5d152) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#acaf990871cadd1134df0c1cfdb00df25) on them returns `false`.
* Use the usual methods to retrieve the estimated logical size as well as the position of the unreliable codes detected.
  ![](assets/images/easymatrixcode2/unreadable.webp)
* Since the data part is no longer a rejection criterion, the likelihood that a false positive code is returned increases.
* To filter out these false positive detections, use the value returned by [`EMatrixCode::GetReliabilityScore`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#ae340c1b72e048df08def366589274e5e) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#abf15b85b58a58bb9c52c667bbe65509f) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCode.html#a70e7f5a188aff5d3b58f587675c6b76c) as a filtering threshold. This score translates as confidence that the detected object is an actual data matrix code.

<a id="mxc2-asynchronous"></a>

## Asynchronous Processing

**EasyMatrixCode** supports asynchronous processing. This means that you can launch multiple processing threads in parallel, each reading the matrix codes in its own image.

From the main thread, to manually stop the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method in any of these processing threads at any time, use the [`EMatrixCodeReader::StopProcess`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a64a4ac29123e3b6c482dfd10a26b271f) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a3f45e67b7d1fbcf47ba3a51b1ad33e92) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6910648bd7c1063b073a0f8dbfd7a52f) method.

When you manually stop the [`EMatrixCodeReader::Read`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a890b23ec2a4a8396cb9c70eac513fc02) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#ad08f5fd519e6a442d9432e056833d764) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#abb1ad9145229c3dd52fe1b576099f6c6) method:

* The search for matrix codes stops immediately, whether it has found matrix codes in the image or not.
* To retrieve all matrix codes found before the manual stop, use the [`EMatrixCodeReader::GetReadResults`](../../../doxygen_cpp/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a09665a012c40c103171147527a3cc044) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#a6eda79033e89fb156c31f77b428df09e) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyMatrixCode2_1_1EMatrixCodeReader.html#acc14666a6864268b814aa964bdbd9d62) accessor.
