F_VN_RemapImageExp

F_VN_RemapImageExp 1:

Remap an image with custom maps, i.e. ipDestImage(x,y) = ipSrcImage(mapX(x,y), mapY(x,y)). Supported pairs are (ipMap1 = ET_REAL, 2 channels; ipMap2 = 0), (ipMap1 = ET_REAL, 1 channel; ipMap2 = ET_REAL, 1 channel), (ipMap1 = ET_INT, 2 channels; ipMap2 = ET_UINT, 1 channel), (ipMap1 = ET_INT, 2 channels; ipMap2 = 0). (expert function)
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

FUNCTION F_VN_RemapImageExp : HRESULT
VAR_INPUT
    ipSrcImage           : ITcVnImage;
    ipDestImage          : Reference To ITcVnImage;
    ipMap1               : ITcVnImage;
    ipMap2               : ITcVnImage;
    bRelativeMap         : BOOL;
    eInterpolationType   : ETcVnInterpolationType;
    eBorderInterpolation : ETcVnBorderInterpolationMethod;
END_VAR
VAR_IN_OUT
    aBorderValue         : TcVnVector4_LREAL;
END_VAR
VAR_INPUT
    hrPrev               : HRESULT;
END_VAR

 Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image

ipDestImage

Reference To ITcVnImage

Destination image (Must not be the same as ipSrcImage! Has the same size as ipMap1 and the same type as ipSrcImage. An appropriate destination image will be created if required.)

ipMap1

ITcVnImage

Map 1 (ET_REAL with 2 channels (containing mapX, mapY) or ET_REAL with 1 channel (containing mapX) or ET_INT with 2 channels (containing rounded mapX, mapY))

ipMap2

ITcVnImage

Map 2 (ET_REAL with 1 channel (containing mapY) or ET_UINT with 1 channel (containing interpolation table coefficients if ipMap1 is ET_INT with 2 channels), otherwise set to 0 if not required.

bRelativeMap

BOOL

If true, the maps contain relative coordinates, i.e. ipDestImage(x,y) = ipSrcImage(x + mapX(x,y), y + mapY(x,y)).

eInterpolationType

ETcVnInterpolationType

Interpolation type (AREA_BASED, BILINEAR_EXACT and NEAREST_NEIGHBOR_EXACT are not supported)

eBorderInterpolation

ETcVnBorderInterpolationMethod

Border interpolation method (ISOLATED not supported)

hrPrev

HRESULT

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

 In/Outputs

Name

Type

Description

aBorderValue

TcVnVector4_LREAL

Border value, if CONSTANT is used

 Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4026 or later

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

Tc3_Vision