Code covered by the BSD License  

Highlights from
Rotate an image around a point

5.0

5.0 | 4 ratings Rate this file 52 Downloads (last 30 days) File Size: 4.5 KB File ID: #40469
image thumbnail

Rotate an image around a point

by

 

22 Feb 2013 (Updated )

Performs rotation of an image around any point inside of the image.

| Watch this File

File Information
Description

The rotation around a point is performed in following sequence:
1) Padding of the image.
2) Rotation of the image around the image's center with IMROTATE.
3) Cropping of the image.

Required Products Image Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
19 Jul 2014 Gaurav Mittal

Thanks, works great.

01 May 2014 Yun Inn  
21 Apr 2014 Jan Motl

Thanks for suggestion. I swapped the parameters of the function call.

03 Mar 2014 Juan P. Viera

Really useful. I think you should change the rotation line:
rot = imrotate(padded,angle,'crop',method);
for
rot = imrotate(padded,angle,method,'crop');

12 Jul 2013 jamesyu92

Works great for me.

Updates
21 Apr 2014

Extended support from grayscale to RGB images. Swapped order of the parameters in imrotate function call.

01 May 2014

Removed dependency on deg2rad function.

Contact us