RemapImage
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).
Can use available TwinCAT Job Tasks for executing parallel code regions.
Syntax
Definition:
HRESULT RemapImage(
HRESULT hrPrev,
ITcVnImage* ipSrcImage,
ITcVnImage*& ipDestImage,
ITcVnImage* ipMap1,
ITcVnImage* ipMap2,
bool bRelativeMap = false,
ETcVnInterpolationType eInterpolationType = IT_BILINEAR,
ETcVnBorderInterpolationMethod eBorderInterpolation = BIM_CONSTANT,
TcVnVector4_LREAL& aBorderValue = {0, 0, 0, 0}
)Parameters
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
hrPrev |
|
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) | |
|
ipSrcImage |
|
Source image | |
|
ipDestImage |
|
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 |
|
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 |
|
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 |
false |
If true, the maps contain relative coordinates, i.e. ipDestImage(x,y) = ipSrcImage(x + mapX(x,y), y + mapY(x,y)). |
|
eInterpolationType |
IT_BILINEAR |
Interpolation type (AREA_BASED, BILINEAR_EXACT and NEAREST_NEIGHBOR_EXACT are not supported) | |
|
eBorderInterpolation |
BIM_CONSTANT |
Border interpolation method (ISOLATED not supported) | |
|
aBorderValue |
{0, 0, 0, 0} |
Border value, if CONSTANT is used |
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 |