Image Processing Toolbox User's Guide Previous page   Next Page
imresize

Resize image

Syntax

Description

B = imresize(A,m) returns image 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.

B = imresize(...,method,n) When the specified output size is smaller than the size of the input image, and 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.

B = imresize(...,method,h) When the specified output size is smaller than the size of the input image, and 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


Previous page  imregionalmin imrotate Next page

© 1994-2005 The MathWorks, Inc.