F_VN_SetRoi
Sets a region of interest (ROI) within an image.
Syntax
Definition:
FUNCTION F_VN_SetRoi : HRESULT
VAR_INPUT
nX : UDINT;
nY : UDINT;
nWidth : UDINT;
nHeight : UDINT;
ipDestImage : ITcVnImage;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
nX |
UDINT |
Left boundary (inclusive 0-based index) |
nY |
UDINT |
Upper boundary (inclusive 0-based index) |
nWidth |
UDINT |
ROI width |
nHeight |
UDINT |
ROI height |
ipDestImage |
Destination image | |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Further information
The function F_VN_SetRoi
sets the Region of Interest of an image. The function F_VN_SetRoi_TcVnRectangle_UDINT can be used if the rectangle parameters are not to be transferred individually, but as a structure of the type TcVnRectangle_UDINT.
Application
The setting of an ROI with the size [240, 120]
at the position [50, 50]
looks like this, for example:
hr := F_VN_SetRoi(50, 50, 240, 120, ipImageWork, hr);
Related functions
- F_VN_SetRoi for setting a Region of Interest
- F_VN_GetRoi for retrieving the set Region of Interest
- F_VN_ResetRoi for resetting the Region of Interest on the entire image
- F_VN_CopyImageRegion for copying an image region
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 |