F_VN_FuseImages

F_VN_FuseImages 1:

Fuse 2 images vertically (intended for line scan cameras).

Syntax

Definition:

FUNCTION F_VN_FuseImages : HRESULT
VAR_INPUT
    ipSrcImage1 : ITcVnImage;
    ipSrcImage2 : ITcVnImage;
    ipDestImage : Reference To ITcVnImage;
    nFirstLine  : UDINT;
    nNumLines   : UDINT;
    hrPrev      : HRESULT;
END_VAR

F_VN_FuseImages 2: Inputs

Name

Type

Description

ipSrcImage1

ITcVnImage

Source image 1

ipSrcImage2

ITcVnImage

Source image 2

ipDestImage

Reference To ITcVnImage

Destination image

nFirstLine

UDINT

Line index in ipSrcImage1, which is the first line in ipDestImage

nNumLines

UDINT

The number of lines that should be copied to ipDestImage, starting with nFirstLine in ipSrcImage1. Once the last line of ipSrcImage1 was copied, the remaining lines are copied from ipSrcImage2, starting at line index 0.

hrPrev

HRESULT

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

F_VN_FuseImages 3: Return value

HRESULT

Further information

The function F_VN_FuseImages joins two images to form a new contiguous image. This is of particular interest for line scan cameras.

The function F_VN_FuseImagesArray can be used to fuse up to 10 images.

Application

Line scan cameras usually return a given number of successively captured lines as a 2D image. This 2D image can contain an entire object of interest (shown in green in the figure below), or it can contain part of an object (shown in red in the figure).

F_VN_FuseImages 4:
F_VN_FuseImages 5:

To analyze the red object, the function F_VN_FuseImages can be used to fuse the two object parts to form an complete image. If it is known which lines relate to the object, the linking can be limited to the relevant lines.

F_VN_FuseImages(ipImage1, ipImage2, ipFusedImage, 6, 7, S_OK);
F_VN_FuseImages 6:

Samples

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