Retrieving the Decoded String (Simple)¶
This code snippet shows how to read a QR code and retrieve the decoded string.
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 data of the first QR code found in best guess mode
std::string decodedString = 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 data of the first QR code found in best guess mode
string decodedString = qrCodes[0].GetDecodedString(EByteInterpretationMode.Auto);
See also
EQRCodeReader.Read C++ Python, EQRCode.GetDecodedString C++ Python
Python¶
import eVision
# Image constructor
src_image = eVision.EImageBW8()
# QR code reader constructor
reader = eVision.EQRCodeReader()
# ...
# Read
qr_codes = reader.Read(src_image)
# Retrieve the data of the first QR code found in best guess mode
decoded_string = qr_codes[0].GetDecodedString(eVision.EByteInterpretationMode.Auto)
See also
EQRCodeReader.Read C++ .NET, EQRCode.GetDecodedString C++ .NET