GradeBarcode
Grades a 1D barcode according to ISO / IEC 15416:2016. Requires uniform illumination, good focus and the image sensor plane parallel to the code plane to achieve meaningful results.
Can use available TwinCAT Job Tasks for executing parallel code regions.
Syntax
Definition:
HRESULT GradeBarcode(
HRESULT hrPrev,
ITcVnImage* ipSrcImage,
ITcVnContainer*& ipDecodedData,
TcVnCodeGrades1D& stCodeGrades,
ETcVnBarcodeType eBarcodeType,
float& fAngleDeg,
ETcVnBarcodeSearchDirection eSearchDirection = BSD_ANY,
ITcVnImage** pipResultVisualization = nullptr,
ITcVnContainer** pipScanLineInfo = 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 horizontally aligned barcode region (USINT, 1 channel, including quiet zones on left and right, excluding Text or empty space on more than 10% total height on top or bottom) | |
ipDecodedData |
|
Returns the decoded data (ContainerType_String_SINT) | |
stCodeGrades |
|
Returns the code grades in the range from 0 (very bad) to 4 (very good) | |
eBarcodeType |
|
Type of the barcode (supported: CODE39, CODE128, EAN8, EAN13, ITF, UPCA, UPCE) | |
fAngleDeg |
float& |
|
Returns the approximate clockwise rotation angle in degree |
eSearchDirection |
BSD_ANY |
Barcode search direction (BSD_ANY first tries horizontal, then vertical) | |
pipResultVisualization |
nullptr |
Returns a visualization of the scan lines (optional, set to 0 if not required). Grades are color coded: >= 3 as green, >= 2 as light blue, >= 1 as orange, < 1 as red | |
pipScanLineInfo |
nullptr |
Returns additional scan line info for further evaluation, e.g. to use PlotIntensityProfile for visualization (optional, set to 0 if not required; ContainerType_Vector_TcVnVector3_REAL, containing [row index, overall grade, threshold]) | |
pipContour |
nullptr |
Returns the 4 approximate code corner points, including 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.59 or later | PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU | Tc3_Vision |