Resizes an image.
img_out = resize(img_in, size[, scale_x[, scale_y[, interpolation]]])
Input image (Mat).
Output image dimensions (double matrix [width, height]
).
Scale factor along the X axis (double matrix) (default 0).
Scale factor along the Y axis (double matrix) (default 0).
Interpolation method (double matrix):
INTER_NEAREST
: a nearest-neighbor interpolation.INTER_LINEAR
: a bilinear interpolation (default).INTER_AREA
: resampling using pixel area relation.INTER_CUBIC
: a bicubic interpolation over 4x4 pixel neighborhood.INTER_LANCZOS4
: a Lanczos interpolation over 8x8 pixel neighborhood.Output image (Mat).
resize
resizes an image, either to the specified size size, or by using the scale factors scale_x and scale_y.
scicv_Init(); img = imread(getSampleImage("lena.jpg")); // Resize to a [100, 100] pixels image img_100x100 = resize(img, [100, 100]); subplot(1,2,1); matplot(img_100x100); // Resize to a half size image img_half = resize(img, 0, 0.5, 0.5); subplot(1,2,2); matplot(img_half); delete_Mat(img); delete_Mat(img_100x100); delete_Mat(img_half); | ![]() | ![]() |