F_VN_SetRoi

F_VN_SetRoi 1:

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

F_VN_SetRoi 2: 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

ITcVnImage

Destination image

hrPrev

HRESULT

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

F_VN_SetRoi 3: Return value

HRESULT

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

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