F_VN_GetRoi
Gets the coordinates of the region of interest (ROI) within the image.
Syntax
Definition:
FUNCTION F_VN_GetRoi : HRESULT
VAR_INPUT
    ipSrcImage : ITcVnImage;
END_VAR
VAR_IN_OUT
    stRoi      : TcVnRectangle_UDINT;
END_VAR
VAR_INPUT
    hrPrev     : HRESULT;
END_VAR
          
 Inputs
| 
                   Name  | 
                   Type  | 
                   Description  | 
|---|---|---|
| 
                   ipSrcImage  | 
                   Source image  | |
| 
                   hrPrev  | 
                   HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)  | 
          
 In/Outputs
| 
                   Name  | 
                   Type  | 
                   Description  | 
|---|---|---|
| 
                   stRoi  | 
                   Returns the coordinates of the region of interest  | 
Weiterführende Informationen
Die Funktion F_VN_GetRoi zeigt an, welche Region Of Interest zurzeit auf dem Eingangsbild ipSrcImage gesetzt ist. Die Information wird z. B. benötigt, wenn Punkte in dem Bild in Relation zum Gesamtbild angegeben werden sollen oder wenn die ROI dynamisch vergrößert werden soll.
Anwendung
Das Beziehen eines Punktes auf die Koordinaten des Originalbildes sieht z. B. so aus:
hr := F_VN_ContourCenterOfMass(ipContour, aCenter, hr);
hr := F_VN_GetRoi(ipImageWork, stRoi, hr);
aCenter[0] := aCenter[0] + stRoi.nX;
aCenter[1] := aCenter[1] + stRoi.nY;Verwandte Funktionen
- F_VN_SetRoi zum Setzen einer Region of Interest
 - F_VN_GetRoi zum Abrufen der gesetzten Region of Interest
 - F_VN_ResetRoi zum Zurücksetzen der Region of Interest auf das gesamte Bild
 - F_VN_CopyImageRegion zum Kopieren eines Bildausschnitts
 
Required License
TC3 Vision Base
System Requirements
Development environment  | Target platform  | PLC libraries to include  | 
|---|---|---|
TwinCAT V3.1.4024.59 or later  | PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU  | Tc3_Vision  | 
 Return value