Image Processing Toolbox User's Guide |
Syntax
B = imresize(A,m) B = imresize(A,m,method
) B = imresize(A,[mrows ncols],method
) B = imresize(...,method
,n) B = imresize(...,method
,h)
Description
returns image B = imresize(A,m)
B
that is m
times the size of A.A
can be an indexed image, grayscale image, RGB, or binary image. If m
is between 0 and 1.0, B
is smaller than A
. If m
is greater than 1.0, B
is larger than A
. When resizing the image, imresize
uses nearest-neighbor interpolation.
B = imresize(A,m,method)
returns an image that is m
times the size of A
using the interpolation method specified by method
. method
is a string that can have one of these values. The default value is enclosed in braces ({}
).
Value |
Description |
{'nearest'} |
Nearest-neighbor interpolation |
'bilinear' |
Bilinear interpolation |
'bicubic' |
Bicubic interpolation |
B = imresize(A,[mrows ncols],method)
returns an image of the size specified by [mrows ncols]
. If the specified size does not produce the same aspect ratio as the input image has, the output image is distorted.
When the specified output size is smaller than the size of the input image, and B = imresize(...,method,n)
method
is 'bilinear'
or 'bicubic'
, imresize
applies a lowpass filter before interpolation to reduce aliasing. n
is an integer scalar specifying the size of the filter, which is n
-by-n
. If n
is 0 (zero), imresize
omits the filtering step. If you do not specify a size, the default filter size is 11-by-11.
When the specified output size is smaller than the size of the input image, and B
= imresize(...
,method
,h)
method
is 'bilinear'
or 'bicubic'
, you can also specify a two-dimensional FIR filter, h
, such as those returned by ftrans2
, fwind1
, fwind2
, or fsamp2
.
Class Support
The input image can be numeric or logical and it must be nonsparse. The output image is of the same class as the input image.
See Also
imrotate
, imtransform
, tformarray
interp2
in the MATLAB Function Reference
imregionalmin | imrotate |
© 1994-2005 The MathWorks, Inc.