EasyMatrixCode - Reading Matrix Codes
![]() |
![]() |
Data Matrix code (ECC 200, 26x26 cells) |
Data Matrix code finder pattern |
In a single read operation, EasyMatrixCode locates, unscrambles, decodes, reads and grades the quality of grayscale 2D Data Matrix codes of any size, contrast, location and orientation (even viewed from the back on a transparent medium), providing they meet these specifications:
- Minimum quiet zone (blank zone around the matrix code) width: 3 pixels.
- Minimum cell (= module) size: 3x3 pixels.
- Maximum stretching (ratio between cell width and height): 2.
A data matrix code can be read even when damaged, using a built in error correction system.

A data matrix code is a two-dimensional rectangular array of black and white cells which conveys a string of characters (digits, letters and special characters). It is encoded to achieve maximum packing. Each cell corresponds to a bit of information, redundant bits are added to allow error correction for robust reading of degraded symbols.
- It is located using the Finder pattern: The bottom and left edges of a Data Matrix code contain only black cells, while the top and right edges have alternating cells.
- It is characterized by its logical size (number of cells), contrast type and its encoding type; ECC 000, ECC 050, ECC 080, ECC 100, ECC 140 (odd symbol sizes) and ECC 200 (even symbol sizes).
Note: The data matrix code definition is provided by AIM International Inc. (PA) and is approved as standard ANSI/AIM BC11-1997.

You can Read a matrix code automatically, or you can read a saved matrix code.
EMatrixCode and EMatrixCodeReader objects feature Save and Load methods which use a file to store and restore the object state (learned parameters, decoded string, grading values, ...). The process of saving and loading files is called serialization.
To restore the state of an EMatrixCode and use it to read a matrix code:
- Load an image.
- Restore the reader state from the given file EMatrixCodeReader::.Load.
- Read the image.
- Display the decoded string.

Print quality can be computed as defined by BC11, ISO 15415, ISO/IEC TR 29158 and SEMI T10-0701 standards.
Simply enable grading before the Read method, then GetIso15415GradingParameters, GetIso29158GradingParameters or GetSemiT10GradingParameters.

You can search for specific features by learning a Matrix code model.
Learn Workflow
Learn and read method
- Load the image of the Matrix Code to be learned.
- Learn the model : using the Learn method with Contrast, Family, Flipping, Logical Size parameters.
If several matrix codes need to be learned, then use LearnMore, and pass additional sample images.
Calling Learn replaces EMatrixCodeReader parameters, so calling Learn several times does not accumulate results, which LearnMore does. - Tune search parameters to be efficient:
- read only matrix codes that match a sample matrix code,
- or read only matrix codes that have the same properties (Contrast, Family, Flipping, Logical Size) as the learned one,
- or disregard a search parameter of the learned matrix code SetLearnMaskElement, for example to read only unflipped matrixcodes. Just remove the default parameters, then add new ones. - Ask EMatrixCodeReader to decode the supplied image.
- Display the decoded string.
- Save the state of the reader object.