Reading a Grid of Matrix Codes¶
This code snippet shows how to read matrixcodes that are disposed in a 5 by 3 grid with 10% overlap between grid cells.
C++¶
#include <eVision/EasyMatrixCode/EasyMatrixCode2/EMatrixCodeReader.h>
using namespace eVision;
namespace EMC2 = eVision::EasyMatrixCode2;
EImageBW8 srcImage;
ERectangleRegion gridRegion;
EMC2::EMatrixCodeReader reader;
// Reading succeeds
EMC2::EMatrixCodeGrid grid = reader.Read(srcImage, gridRegion, 3, 5, 0.1f);
std::vector<EMC2::EMatrixCode> codesMiddleCell = grid.GetResults(1, 2);
See also
EMatrixCodeReader::Read .NET Python, EMatrixCodeGrid .NET Python
C#¶
using eVision;
using EMC2 = eVision.EasyMatrixCode2;
EImageBW8 srcImage = new EImageBW8();
ERectangleRegion gridRegion = new ERectangleRegion();
EMC2.EMatrixCodeReader reader = new EMC2.EMatrixCodeReader();
// Reading succeeds
EMC2.EMatrixCodeGrid grid = reader.Read(srcImage, gridRegion, 3, 5, 0.1f);
EMC2.EMatrixCode[] codesMiddleCell = grid.GetResults(1, 2);
See also
EMatrixCodeReader.Read C++ Python, EMatrixCodeGrid C++ Python
Python¶
import eVision
from eVision import EasyMatrixCode2 as EMC2
src_image = eVision.EImageBW8()
gridRegion = eVision.ERectangleRegion()
reader = EMC2.EMatrixCodeReader()
# Reading succeeds
grid = reader.Read(src_image, gridRegion, 3, 5, 0.1)
codesMiddleCell = grid.GetResults(1, 2)
See also