Reading QR Codes

This code snippet shows how to read a QR code and retrieve the decoded data.

C++

#include <eVision/EasyQRCode/EQRCodeReader.h>
using namespace eVision;

// Image constructor
EImageBW8 srcImage;

// QR code reader constructor
EQRCodeReader reader;

// ...

// Read
std::vector<EQRCode> qrCodes = reader.Read(srcImage);

// Retrieve the decoded string in best guess mode from the first QR Code
std::string decoded_string = qrCodes[0].GetDecodedString(EByteInterpretationMode_Auto);

C#

using eVision;
// Image constructor
EImageBW8 srcImage = new EImageBW8();

// QR code reader constructor
EQRCodeReader reader = new EQRCodeReader();

// ...

// Read
EQRCode[] qrCodes = reader.Read(srcImage);

// Retrieve the decoded string in best guess mode from the first QR Code
string decoded_string = qrCodes[0].GetDecodedString(EByteInterpretationMode.Auto);

Python

import eVision
# Image constructor
src_image = eVision.EImageBW8()

# QR code reader constructor
reader = eVision.EQRCodeReader()

# ...

# Detect QRCodes in src_image
qr_codes = reader.Read(src_image)

# Retrieve the decoded string in best guess mode from the first QR Code
decoded_string = qr_codes[0].GetDecodedString(eVision.EByteInterpretationMode.Auto)