EasyBarCode - Reading Bar Codes

EasyBarCode

A bar code read by the EasyBarCode library.

Bar Code Definition

A bar code is a 2D pattern of parallel bars and spaces of varying thickness that represents a character string.

These bars and spaces are arranged according to a convention named symbology (see supported symbologies), that specifies the character set and the encoding rules.

Purpose of the EasyBarCode library

The EasyBarCode library allows to read bar codes in images:

  • The reading is fast and robust.

  • Several codes can be read in the same image.

  • Many symbologies are supported

  • The processing can be limited to an ERegion .NET Python in the image.

  • Specific support is provided for codes arranged in a grid.

  • The bar codes can be graded according to the ISO 15416 norms.

Note

Using a different set of classes, the EasyBarCode library also supports mail bar codes.

Reading Bar Codes

Warning

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

Note

The relevant classes of the EasyBarCode library are stored in the namespace EasyBarCode2. Classes outside that namespace (refered to as EasyBarCode1) are an earlier version of the EasyBarCode library, now deprecated.

#include <eVision/EasyBarCode/EasyBarCode2/EBarCodeReader.h>
using namespace eVision;

// Image constructor
EImageBW8 srcImage;

// Bar code reader constructor
EasyBarCode2::EBarCodeReader reader;

// Set the max number of bar codes to find
reader.SetMaxNumCodes(6);

// Read the barcodes in the source image
std::vector<EasyBarCode2::EBarCode> 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
eVision.EasyBarCode2.EBarCodeReader reader = new eVision.EasyBarCode2.EBarCodeReader();

// Set the max number of bar codes to find
reader.MaxNumCodes = 6;

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

// Get decoded string
string decodedString = results[0].GetDecodedString();
import eVision
from eVision import EasyBarCode2

# Image constructor
srcImage = eVision.EImageBW8()

# Bar code reader constructor
reader = EasyBarCode2.EBarCodeReader()

# Set the max number of bar codes to find
reader.MaxNumCodes = 6

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

# Get decoded string
decodedString = results[0].GetDecodedString()

Contents

Using EasyBarCode

How to use the EasyBarCode library.

Using EasyBarCode
Reading mail bar codes

How to use the EasyBarCode library to read mail bar codes.

EasyMailBarCode - Reading Mail Bar Codes
Using EasyBarCode1 (deprecated)

How to use the first version of the EasyBarCode library, now deprecated.

EasyBarCode1 - Reading Bar Codes (deprecated)