FindContourHierarchy (Exp)
Search for object contours in a binary image and determine their hierarchical relationship.
Can use available TwinCAT Job Tasks for executing parallel code regions.
Can return partial results when canceled by Watchdog.
Syntax
Definition:
HRESULT FindContourHierarchy(
HRESULT hrPrev,
ITcVnImage* ipSrcImage,
ITcVnContainer*& ipContours,
ITcVnContainer*& ipHierarchy,
ETcVnContourRetrievalMode eRetrievalMode,
ETcVnContourApproximationMethod eApproximationMethod,
TcVnPoint& aOffset
)
Parameters
Name |
Type |
Description |
---|---|---|
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) | |
ipSrcImage |
Source image (1 channel, binary) | |
ipContours |
Returns a container which is filled with the found contours (ContainerType_Vector_Vector_TcVnPoint2_DINT; The elements of this container are single contours. Non-zero interface pointers are reused.) | |
ipHierarchy |
Returns a container which is filled with information on the found contours' hierarchy (ContainerType_Vector_TcVnVector4_DINT; The elements of this container are four-dimensional vectors containing the 0-based indices of the next [0] and the previous contour [1] at the same level, the first child [2], and the parent [3]. Non-zero interface pointers are reused.) | |
eRetrievalMode |
Specifies which contours are retrieved and how their relationship is encoded | |
eApproximationMethod |
Contour encoding | |
aOffset |
Offset by which every contour point is shifted |
Required License
TC3 Vision Base
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 |