F_VN_DetectBlobsExp
Detects blob-contours. Applies a threshold, a contour search and offers several options for filtering the found contours. Provides easy setup for multiple thresholds and combination of results. (expert function)
Can use available TwinCAT Job Tasks for executing parallel code regions.
Can return partial results when canceled by Watchdog.
Syntax
Definition:
FUNCTION F_VN_DetectBlobsExp : HRESULT
VAR_INPUT
ipSrcImage : ITcVnImage;
ipBlobContours : Reference To ITcVnContainer;
END_VAR
VAR_IN_OUT
stParams : TcVnParamsBlobDetection;
aOffset : TcVnPoint;
END_VAR
VAR_INPUT
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipSrcImage |
Source image (USINT or REAL, 1 channel or 3 channel (3 channel input is expected to be RGB and internally converted to Gray)) | |
ipBlobContours |
Reference To ITcVnContainer |
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.) |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
In/Outputs
Name |
Type |
Description |
---|---|---|
stParams |
Parameters to filter the detected contours. | |
aOffset |
Offset by which every contour point is shifted |
Further information
The function F_VN_DetectBlobsExp
is the expert version of F_VN_DetectBlobs. It contains additional parameters.
Parameter
Input image
The input image ipSrcImage
must be a 1-channel or 3-channel image of the type USINT
or REAL
. 3-channel images are interpreted as RGB and converted internally into grayscale images.
List of contours found (Return value)
All contours found in the input image are returned in the container ipBlobContours
.
Parameters for blob detection
The parameters stParams
of the structure TcVnParamsBlobDetection define which features a contour in the input image must have in order to be found and returned.
Offset (Expert)
The offset aOffset
defines constant X/Y values by which all contour points are shifted. This can be helpful when contours are sought in an ROI and their positions should be referenced to the original image.
Related functions
- F_VN_FindContours(Exp) for general contour finding
- F_VN_FindContourHierarchyExp with return of the hierarchy
- F_VN_DetectBlobs with integrated filtering of the contours
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 |