F_VN_DetectBlobsExp

F_VN_DetectBlobsExp 1:

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

F_VN_DetectBlobsExp 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

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

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_DetectBlobsExp 3: In/Outputs

Name

Type

Description

stParams

TcVnParamsBlobDetection

Parameters to filter the detected contours.

aOffset

TcVnPoint

Offset by which every contour point is shifted

F_VN_DetectBlobsExp 4: Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_DetectBlobsExp ist die Expert-Variante von F_VN_DetectBlobs. Sie enthält zusätzliche Parameter.

Parameter

Eingangsbild

Das Eingangsbild ipSrcImage muss ein 1- oder 3-kanaliges Bild vom Typ USINT oder REAL sein. Dabei werden 3-kanalige Bilder als RGB-Bilder interpretiert und intern in ein Grauwertbild konvertiert.

Liste an gefundenen Konturen (Rückgabewert)

Alle im Eingangsbild gefundenen Konturen werden in dem Container ipBlobContours zurückgegeben.

Parameter zur Blob-Detektion

Die Parameter stParams der Struktur TcVnParamsBlobDetection legen fest, welche Merkmale eine Kontur im Eingangsbild haben muss, um gefunden und zurückgegeben zu werden.

Offset (Expert)

Das Offset aOffset legt konstante X-/Y-Werte fest, um die alle Konturpunkte verschoben werden. Dies kann hilfreich sein, wenn Konturen in einer ROI gesucht werden und ihre Positionen sich auf das Originalbild beziehen sollen.

Verwandte Funktionen

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision