Image Processing Toolbox User's Guide |
Syntax
Description
rotates image B = imrotate(A,angle)
A
by angle
degrees in a counterclockwise direction around its center point. To rotate the image clockwise, specify a negative value for angle
. imrotate
makes the output image B
large enough to contain the entire rotated image. imrotate
uses nearest neighbor interpolation, setting the values of pixels in B
that are outside the rotated image to 0
(zero).
B = imrotate(A,angle,method)
rotates image A
, using the interpolation method specified by method
. method
is a text string that can have one of these values. The default value is enclosed in braces ({}
).
B = imrotate(A,angle,method,bbox)
rotates image A
, where bbox
specifies the size of the returned image. bbox
is a text string that can have one of the following values. The default value is enclosed in braces ({}
).
Class Support
The input image can be numeric or logical. The output image is of the same class as the input image.
Example
This example reads solar spectra image, stored in FITS format, and rotates the the image to bring it into horizontal alignment. A rotation of -1 degree is all that is required.
I = fitsread('solarspectra.fts'); I = mat2gray(I); J = imrotate(I,-1,'bilinear','crop'); figure, imshow(I) figure, imshow(J)
See Also
imcrop
, imresize
, imtransform
, tformarray
imresize | imscrollpanel |
© 1994-2005 The MathWorks, Inc.