GradeQRCode

Grades a QR code 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 GradeQRCode(
    HRESULT           hrPrev,
    ITcVnImage*       ipSrcImage,
    ITcVnContainer*&  ipDecodedData,
    TcVnCodeGradesQR& stCodeGrades,
    float             fModuleWidth,
    float&            fAngleDeg,
    ITcVnImage**      pipResultVisualization = nullptr,
    ITcVnContainer**  pipMarginGrades = nullptr,
    ITcVnContainer**  pipContour = nullptr
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

ipSrcImage

ITcVnImage*

 

Source image, only containing the QR code region (USINT, 1 channel, including quiet zone)

ipDecodedData

ITcVnContainer*&

 

Returns the decoded data (ContainerType_String_SINT)

stCodeGrades

TcVnCodeGradesQR&

 

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

ITcVnImage**

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

ITcVnContainer**

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

ITcVnContainer**

nullptr

Returns the 4 code corner points, excluding the quiet zone (optional, set to 0 if not required; ContainerType_Vector_TcVnPoint2_DINT)

GradeQRCode 1: Return value

HRESULT

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