Reading a set of Code

This code snippet shows how to read codes of any type.

C++

#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();

C#

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;

Python

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