F_VN_CopyImageRegion
Deep copy the specified region of interest into a new image.
Syntax
Definition:
FUNCTION F_VN_CopyImageRegion : HRESULT
VAR_INPUT
ipSrcImage : ITcVnImage;
nX : UDINT;
nY : UDINT;
nWidth : UDINT;
nHeight : UDINT;
ipDestImage : Reference To ITcVnImage;
hrPrev : HRESULT;
END_VAR
Inputs
|
Name |
Type |
Description |
|---|---|---|
|
ipSrcImage |
Source image | |
|
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 |
Reference To ITcVnImage |
Destination image (An appropriate destination image will be created if required.) |
|
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Further information
The function F_VN_CopyImageRegion creates a deep copy of an image region of the input image ipSrcImage. The image region is specified by a rectangle with position and size, as with an ROI.
![]() | Computing time optimization With regard to computing time optimization, check each image copy for its necessity. |
If a copy is not required, but instead only the image region is to be reduced in size, a Region of Interest can be set instead.
Application
The copying of an image region of the size [240, 120] with the top left corner at the position [50, 50] looks like this, for example:
hr := F_VN_CopyImageRegion(
ipSrcImage := ipImageIn,
nX := 50,
nY := 50,
nWidth := 240,
nHeight := 120,
ipDestImage := ipImageWork,
hrPrev := hr,
);Related functions
- F_VN_CopyImage for copying the entire image
- F_VN_CopyImageRegion for copying an image region
- F_VN_CopyImageRegionToRegion for copying an image region to a certain position
Required License
TC3 Vision Base
Return value