GradeDataMatrixCode
Grades a Data Matrix code (ECC200) according to ISO / IEC 15415:2011. Requires uniform illumination, good focus and the image sensor plane parallel to the code plane to achieve meaningful results.
Syntax
Definition:
HRESULT GradeDataMatrixCode(
HRESULT hrPrev,
ITcVnImage* ipSrcImage,
ITcVnContainer*& ipDecodedData,
TcVnCodeGradesDM& stCodeGrades,
float fModuleWidth,
float& fAngleDeg,
ITcVnImage** pipResultVisualization = nullptr,
ITcVnContainer** pipMarginGrades = nullptr,
ITcVnContainer** pipContour = nullptr
)
Parameters
Name |
Type |
Default |
Description |
---|---|---|---|
hrPrev |
|
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) | |
ipSrcImage |
|
Source image, only containing the Data Matrix code region (USINT, 1 channel, including quiet zone) | |
ipDecodedData |
|
Returns the decoded data (ContainerType_String_SINT) | |
stCodeGrades |
|
Returns the code grades in the range from 0 (very bad) to 4 (very good) | |
fModuleWidth |
float |
|
Minimum module width of the code in the image (in pixels). Must be at least 3, preferably 5 - 8. |
fAngleDeg |
float& |
|
Returns the clockwise rotation angle in degree |
pipResultVisualization |
nullptr |
Returns a visualization of the scan grid (optional, set to 0 if not required). Module margin grades are color coded: >= 3 as green, >= 2 as light blue, >= 1 as orange, < 1 as red | |
pipMarginGrades |
nullptr |
Returns the individual margin grade for each module, e.g. to create a custom visualization (optional, set to 0 if not required; ContainerType_Vector_TcVnVector3_REAL, containing [x-position, y-position, grade]) | |
pipContour |
nullptr |
Returns the 4 code corner points, excluding the quiet zone (optional, set to 0 if not required; ContainerType_Vector_TcVnPoint2_DINT) |
Required License
TC3 Vision Code Quality
System Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT V3.1.4024.54 or later | PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |