Image: Resize...
Resize an image.
Minimum Origin Version Required: 2022
1. cvresize width:=100;
2. cvresize width:=50 height:=50;
3. cvresize interp:=cubic w:=500 h:=437;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input Image | img |
Input/Output ImageLayer |
|
Select the image to resize. Video is not supported. |
Keep Aspect Ratio | aspect |
Input int |
|
Check this checkbox to keep aspect ratio of the source image. |
Width | w |
Input int |
|
Specify the image width after resizing. If Keep Aspect Ratio is selected, Height will be updated accordingly. |
Height | h |
Input int |
|
Specify the image height after resizing. If Keep Aspect Ratio is selected, Width will be updated accordingly. |
By a Factor | f |
Input double |
|
Resize the image (both Width and Height) by the specified factor. |
Interpolation Method | interp |
Input int |
|
Specify the interpolation method used when the image is resized. Option list:
|
This X-Function is used to resize the image to a customized height and width according by specified interpolation method.
Example 1. Resize the image using Lanczos interpolation method
The image is resized down to the half of the original.
The computation uses function from OpenCV Main API. Please refer to the OpenCV Main API Help file, Version 2.4.11.0 and read imgproc. Image Processing topic.
OpenCV Main API Help file, Version 2.4.11.0