ECodeReader - Unified Interface

../../_images/ecodereader.webp

The 3 supported codes in a single image

Purpose of ECodeReader

ECodeReader integrates the functionality of EasyBarCode, EasyMatrixCode and EasyQRCode in a single unified interface.

In a single ECodeReader::Read .NET Python operation, ECodeReader locates and decodes the 3 kinds of codes supported by eVision, namely bar codes, QR codes and data matrix codes.

For more information about these codes and the associated support, please refer to the EasyBarCode, EasyMatrixCode and EasyQRCode user guides.

Reading a Set of Codes

You can read the codes in an image automatically as follows:

#include <eVision/EasyID/ECodeReader.h>
using namespace eVision;

// Image constructor
EImageBW8 srcImage;

// Bar code reader constructor
ECodeReader reader;

// Set the max number of codes of each type to find
reader.SetMaxNumCodesPerType(2);

// Read the barcodes in the source image
std::vector<ECode> results = reader.Read(srcImage);

// Get decoded string
std::string decodedString = results[0].GetDecodedString();
using eVision;
// Image constructor
EImageBW8 srcImage = new EImageBW8();

// Bar code reader constructor
ECodeReader reader = new ECodeReader();

// Set the max number of codes of each type to find
reader.MaxNumCodesPerType = 2;

// Read the bar codes in the source image
ECode[] results = reader.Read(srcImage);

// Get decoded string
string decodedString = results[0].DecodedString;
import eVision

# Image constructor
srcImage = eVision.EImageBW8()

# Bar code reader constructor
reader = eVision.ECodeReader()

# Set the max number of codes of each type to find
reader.MaxNumCodesPerType = 2

# Read the bar codes in the source image
results = reader.Read(srcImage)

# Get decoded string
decodedString = results[0].DecodedString

Read Parameters

Warning

If one of the supported types of code is not present in the image, it is recommended to disable that type. Otherwise the corresponding reader runs and may slow the whole process.

Code Specific Results

The ECodeReader::Read .NET Python method returns a vector of ECode .NET Python, from these:

Multithreading

ECodeReader always parallelizes the location and the decoding of the different types of code.

Reading Using a Grid

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

../../_images/grid3.webp

Reading of codes arranged in a grid