F_VN_AdjustSearchWindowOrientationToLinearEdge

F_VN_AdjustSearchWindowOrientationToLinearEdge 1:

Adjust the search window to be orthogonal to a linear edge. Might be helpful before calling edge localization and distance measurement functions that rely on the search window.
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

FUNCTION F_VN_AdjustSearchWindowOrientationToLinearEdge : HRESULT
VAR_INPUT
    ipSrcImage     : ITcVnImage;
END_VAR
VAR_IN_OUT
    aStartPoint    : TcVnPoint2_REAL;
    aEndPoint      : TcVnPoint2_REAL;
END_VAR
VAR_INPUT
    eEdgeDirection : ETcVnEdgeDirection;
    fMinStrength   : REAL;
    nMaxThickness  : UDINT;
    nSearchLines   : UDINT;
    hrPrev         : HRESULT;
END_VAR

F_VN_AdjustSearchWindowOrientationToLinearEdge 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image

eEdgeDirection

ETcVnEdgeDirection

Specification of the edge direction to search for

fMinStrength

REAL

Specification of the minimum strength (intensity difference) of the edge to search for

nMaxThickness

UDINT

Specification of the maximum thickness of the edge to search for, which means fMinStrength must be reached within nMaxThickness pixels

nSearchLines

UDINT

Width of the search window, i.e. the number of search lines (3, 5, 7, ...), centered around the line specified by aStartPoint and aEndPoint

hrPrev

HRESULT

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

F_VN_AdjustSearchWindowOrientationToLinearEdge 3: In/Outputs

Name

Type

Description

aStartPoint

TcVnPoint2_REAL

Position from which to start the search process (in the direction of aEndPoint), which is not changed

aEndPoint

TcVnPoint2_REAL

Position where the search process ends, which is adjusted by this function

F_VN_AdjustSearchWindowOrientationToLinearEdge 4: Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_AdjustSearchWindowOrientationToLinearEdge rotiert das Suchfeld für Vermessungsfunktionen derart, dass es orthogonal zu einer linearen Kante liegt.

Parameter

Eingangsbild

Das Eingangsbild ipSrcImage muss eine Kante entsprechend den Parametern zur Kantendetektion enthalten.

Suchfeld (Rückgabewert)

Das anzupassende Suchfeld wird als Referenz übergeben, sodass es angepasst werden kann. Das Suchfeld besteht aus der zentralen Suchlinie bestehend aus Startpunkt aStartPoint und Endpunkt aEndPoint sowie der Anzahl der Suchlinien nSearchLines.

Nach dem Funktionsaufruf enthalten aStartPoint und aEndPoint die angepasste, zentrale Suchlinie. Diese ist nun orthogonal zur linearen Kante auf dem Eingangsbild ipSrcImage.

Parameter zur Kantenlokalisierung

Die Parameter eEdgeDirection, fMinStrength und nMaxThickness bestimmen die Suchmerkmale für die lineare Kante auf dem Eingangsbild ipSrcImage. Diese funktionieren analog zur Kantenlokalisierung in F_VN_LocateEdge.

Required License

TC3 Vision Metrology 2D

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