Why is imrotate not rotating an image about its center point?
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 6 Mai 2015
We need to see your code.
Bahar
am 6 Mai 2015
Bearbeitet: Image Analyst
am 6 Mai 2015
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 8 Mai 2015
1 Stimme
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 Kommentar
Bahar
am 8 Mai 2015
Bearbeitet: Walter Roberson
am 8 Mai 2015
Kategorien
Mehr zu Read, Write, and Modify Image finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!