Image Processing Toolbox    
imrotate

Rotate an image

Syntax

Description

B = imrotate(A,angle,method) rotates the image A by angle degrees in a counter-clockwise direction, using the specified interpolation method. method is a string that can have one of these values:

If you omit the method argument, imrotate uses the default method of 'nearest'.

The returned image matrix B is, in general, larger than A to include the whole rotated image. imrotate sets invalid values on the periphery of B to 0.

B = imrotate(A,angle,method,'crop') rotates the image A through angle degrees and returns the central portion which is the same size as A.

Class Support

The input image, A, can be numeric or logical and it must be nonsparse. The output image, B, is of the same class as the input image.

Remarks

To rotate the image clockwise, specify a negative angle.

Example

See Also

imcrop, imresize, imtransform, tformarray


  imresize imshow