ImageResize
The ImageResize node is used to scale 2D images.
Node parameter
-
width
:The width of the image after scaling. -
height
:The height of the image after scaling. -
resize_mode
:Zoom mode.-
INTER_NEAREST:Nearest neighbor sampling.
-
INTER_LINEAR:Linear sampling.
-
INTER_CUBIC:Cubic sampling.
Note:For specific details, you can search for opencv(C++) corresponding parameters with the same name.
-
-
image
:Sets the visual properties of an image in a 2D view.-
Open image visualization.
-
Turn off image visualization.
-
-
image_list
:Sets the visual properties of the image list in 2D view. The property value description is consistent withimage
.
Data signal input and output
Input:
Note:Select one of the data signals to input according to the requirements.
-
image
:-
Data type:Image
-
Input content:Image to be resized
-
-
image_list
:-
Data type:Image
-
Input content:A list of images to resize
-
Output:
-
image
: -
Data type:Image
-
Output content:Resized image
-
image_list
:-
Data type:Image
-
Output content:The resized image list
-
Functional Demo
Use the ImageResize node to scale the 1918 * 1076 image size to 400*400.
Step 1: node preparation
Add Trigger, Load and ImageResize nodes to the node graph.
Step 2: Set the node parameters
-
Set the Load node parameters:
-
tyepe → Image
-
filename → → Select image file name ( example_data/images/image.png )
-
image →
-
-
Set the ImageResize node parameters:
-
width → 400
-
height → 400
-
resize_mode → INTER_NEAREST
-
image →
-
Step 3: Connect node
Step 4: Run
Click the Run button of RVS to Trigger the trigger node.
Running result
As shown in the following figure, the results of the Load and ImageResize nodes are displayed in the 2D view. The ImageReize node scales the 1918*1076 image size to 400 * 400.