Grading a Data Matrix Code

This code snippet shows how to read a data matrix code and retrieve its print quality grading.

C++

#include <eVision/EasyMatrixCode/EasyMatrixCode1/EMatrixCodeReader.h>
using namespace eVision;
// Image constructor
EImageBW8 srcImage;
// Matrix code reader constructor
EMatrixCodeReader reader;
// Matrix code constructor
EMatrixCode mxCode;
// ...
// Enable grading computation
reader.SetComputeGrading(true);
// Read the source image
mxCode = reader.Read(srcImage);
// Retrieve the print quality grading
int axialNonUniformityGrade = mxCode.GetAxialNonUniformityGrade();
int contrastGrade = mxCode.GetContrastGrade();
int printGrowthGrade = mxCode.GetPrintGrowthGrade();
int unusedErrorCorrectionGrade = mxCode.GetUnusedErrorCorrectionGrade();

C#

using eVision;
// Image constructor
EImageBW8 srcImage = new EImageBW8();
// Matrix code reader constructor
EMatrixCodeReader reader = new EMatrixCodeReader();
// Matrix code constructor
EMatrixCode mxCode = new EMatrixCode();
// ...
// Enable grading computation
reader.ComputeGrading = true;
// Read the source image
mxCode = reader.Read(srcImage);
// Retrieve the print quality grading
int axialNonUniformityGrade = mxCode.AxialNonUniformityGrade;
int contrastGrade = mxCode.ContrastGrade;
int printGrowthGrade = mxCode.PrintGrowthGrade;
int unusedErrorCorrectionGrade = mxCode.UnusedErrorCorrectionGrade;

Python

import eVision
# Image constructor
src_image = eVision.EImageBW8()
# Matrix code reader constructor
reader = eVision.EMatrixCodeReader()
# Matrix code constructor
mx_code = eVision.EMatrixCode()
# ...
# Enable grading computation
reader.ComputeGrading = True
# Read the source image
mx_code = reader.Read(src_image)
# Retrieve the print quality grading
axial_non_uniformity_grade = mx_code.AxialNonUniformityGrade
contrast_grade = mx_code.ContrastGrade
print_growth_grade = mx_code.PrintGrowthGrade
unused_error_correctionGrade = mx_code.UnusedErrorCorrectionGrade