F_VN_ReadDotCodeRoiExp
Detect and interpret a DotCode within the provided image. The code should be in the image center and horizontally or vertically aligned. (expert function)
Can use available TwinCAT Job Tasks for executing parallel code regions.
Syntax
Definition:
FUNCTION F_VN_ReadDotCodeRoiExp : HRESULT
VAR_INPUT
ipSrcImage : ITcVnImage;
ipDecodedData : Reference To ITcVnContainer;
fModuleWidth : REAL;
ipContour : Reference To ITcVnContainer;
eOptions : ULINT;
hrPrev : HRESULT;
END_VAR
VAR_OUTPUT
fAngleDeg : REAL;
END_VARInputs
|
Name |
Type |
Description |
|---|---|---|
|
ipSrcImage |
Source image (USINT elements, 1 channel) | |
|
ipDecodedData |
Reference To ITcVnContainer |
Returns the decoded code (ContainerType_String_SINT) |
|
fModuleWidth |
REAL |
Average dot diameter of the code in the image (in pixels). Must be at least 3, preferably 5 - 8. |
|
ipContour |
Reference To ITcVnContainer |
Returns the contour of the detected code (ContainerType_Vector_TcVnPoint2_DINT; optional, set to 0 if not required) |
|
eOptions |
ULINT |
Specifies a combination of one or more ETcVnDotCodeOptions |
|
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
fAngleDeg |
REAL |
Returns the clockwise rotation angle in degree |
Further information
The F_VN_ReadDotCodeRoiExp function is the expert variant of F_VN_ReadDotCodeRoi and contains additional parameters.
ipContour
The parameter ipContour returns the code corner points as four contour points of the type ContainerType_Vector_TcVnPoint2_DINT. The coordinates correspond to the centers of the theoretical corner modules of the DotCode grid, regardless of whether a dot is actually printed at the respective corner. The contour can be drawn directly with F_VN_DrawContours, for example, or further analyzed with the Contour Analysis functions. This parameter is optional and can be set to 0 if it is not required.
eOptions
The eOptions parameter (ETcVnDotCodeOptions) defines the recognition and preprocessing strategies. Some of the options can be combined (using a bitwise OR operation). The following settings are available:
TCVN_DCO_DEFAULT: Expects a grayscale image and uses the standard algorithm.TCVN_DCO_BINARY_INPUT: Expects an already binarized image (pixel values exclusively 0 or 255). This deactivates the internal preprocessing.TCVN_DCO_DETECTBLOBS: Modifies the algorithm and uses blob detection to find the individual dots. (Cannot be combined withBINARY_INPUTorFILTERCONTOURS).TCVN_DCO_FILTERCONTOURS: Activates a preprocessing step that filters out contours at the edge of the image as well as contours with a strongly deviating size (relative tofModuleWidth).TCVN_DCO_REGULAR_COLOR: Restricts the search to regular codes only (dark dots on a light background).TCVN_DCO_INVERTED_COLOR: Restricts the search to inverted codes only (light dots on a dark background).
Related functions
Required License
TC3 Vision Code Reading