Why is imrotate not rotating an image about its center point?
Show older comments
Based on imrotate documentation, it rotates the image around its center point. If so why do I get the following result when I rotate my initial image I2D (256x256)to get I2DT? The dot is the center point in the original image. Shouldn't be at the same location? I have found the transformation matrix between the original and the rotated image using imregform. Even though I only applied rotation there is still a translation between the two images. The first two elements of the 3rd row in transformation matrix are nowhere near zero.

I have also tried to rotate the original image with imrotate having the 'crop' option on. This is the result:

Now it looks like the image is rotating about the center point, but the transformation matrix (found using imregform) indicates that there is still some translation. How could this be?
Please help! I'm very confused.
Thank you.
Bahar
2 Comments
Walter Roberson
on 6 May 2015
We need to see your code.
Bahar
on 6 May 2015
Edited: Image Analyst
on 6 May 2015
Accepted Answer
More Answers (1)
Walter Roberson
on 8 May 2015
1 vote
imrotate() without 'crop' produces a large result array unless the angle is a multiple of 90 degrees. imshowpair() applied to two images of different size pads the bottom right of the smaller matrix with 0's so they can both be shown. The mismatch of center points on the graph is an artifact of the way you are displaying the images.
I do not currently have an explanation for why you see a translation when you rotate with crop. What is your output Tmatrix ?
1 Comment
Bahar
on 8 May 2015
Edited: Walter Roberson
on 8 May 2015
Categories
Find more on Read, Write, and Modify Image in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!