EasyMatrixCode - Reading Matrix Codes¶
A data matrix code read by the EasyMatrixCode library.¶
Purpose¶
The EasyMatrixCode library reads data matrix codes in images:
The reading is fast and robust.
It can read several codes in the same image.
You can limit the processing to an
ERegionin the image.It provides specific support for codes arranged in a grid.
You can grade the data matrix codes according to the
ISO 15415,ISO 29158orSemi T10standards.
Reading a Data Matrix Code¶
To automatically read the matrix code in an image:
Create an
EMatrixCodeReader.NET Python object.Call the
EMatrixCodeReader::Read.NET Python method to return a vector ofEMatrixCode.NET Python.For each
EMatrixCodeinstance, useGetDecodedString.NET Python to get the decoded string embedded in the data matrix code.
Note
The relevant classes of the EasyMatrixCode library are stored in the namespace EasyMatrixCode2. Classes outside that namespace (referred to as EasyMatrixCode1) are an earlier version of the EasyMatrixCode library, now deprecated.
#include <eVision/EasyMatrixCode/EasyMatrixCode2/EMatrixCodeReader.h>
using namespace eVision;
namespace EMC2 = eVision::EasyMatrixCode2;
// Load an image
EImageBW8 image;
image.Load("image.bmp");
// Prepare a matrix code reader
EMC2::EMatrixCodeReader reader;
// Let the reader know that there are no more than 3 codes in the image
reader.SetMaxNumCodes(3);
// Read the source image
reader.Read(image);
// Retrieve the detected codes
std::vector<EMC2::EMatrixCode> codes = reader.GetReadResults();
// Retrieve the decoded string for the first code
std::string result = codes[0].GetDecodedString();
using eVision;
using EMC2 = eVision.EasyMatrixCode2;
// Load an image
EImageBW8 image = new EImageBW8();
image.Load("image.bmp");
// Prepare a matrix code reader
EMC2.EMatrixCodeReader reader = new EMC2.EMatrixCodeReader();
// Let the reader know that there are no more than 3 codes in the image
reader.MaxNumCodes = 3;
// Read the source image
reader.Read(image);
// Retrieve the detected codes
EMC2.EMatrixCode[] codes = reader.ReadResults;
// Retrieve the decoded string for the first code
string result = codes[0].DecodedString;
import eVision
from eVision import EasyMatrixCode2 as EMC2
# Load an image
image = eVision.EImageBW8()
image.Load("image.bmp")
# Prepare a matrix code reader
reader = EMC2.EMatrixCodeReader()
# Let the reader know that there are no more than 3 codes in the image
reader.MaxNumCodes = 3
# Read the source image
codes = reader.Read(image)
# Retrieve the decoded string for the first code
result = codes[0].DecodedString
Contents¶
Specifications of the data matrix and EasyMatrixCode library.
How to use the EasyMatrixCode library.
How to use the first version of the EasyMatrixCode library, now deprecated.
Quick Links¶
List of all classes, structs and enumerations of the EasyMatrixCode library.
Code snippets for the EasyMatrixCode library.
All the code symbologies read by the text and code reading libraries.
Assess the printing quality of your bar, data matrix and QR codes.
Read bar, data matrix and QR codes using a unified interface.
See also
Some eVision Studio samples illustrate several aspects of the EasyMatrixCode library:
Data matrix readinguses EasyMatrixCode to read a data matrix code in an image.Matrix code griduses EasyMatrixCode to read several data matrix codes ordered in a grid setting in an image.