GetConnectedComponent
Get the mask image (and optionally the outer contour) of a connected component from a label image based on the label ID.
Can use available TwinCAT Job Tasks for executing parallel code regions.
Syntax
Definition:
HRESULT GetConnectedComponent(
HRESULT hrPrev,
ITcVnImage* ipLabelImage,
LONG nLabelID,
ITcVnImage*& ipMaskImage,
ITcVnContainer** pipContourPoints = nullptr
)
Parameters
Name |
Type |
Default |
Description |
---|---|---|---|
hrPrev |
|
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) | |
ipLabelImage |
|
Image containing labels for each pixel (1 channel DINT or UINT). | |
nLabelID |
LONG |
|
Value of the requested label |
ipMaskImage |
|
Returns a mask image marking the pixels that belong to the component (1 channel USINT. Mask is optional, set to 0 if not required.) | |
pipContourPoints |
nullptr |
Returns the outer contour of the component(ContainerType_Vector_TcVnPoint2_DINT. Contour is optional, set to 0 if not required.) |
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 |