问题
What is the method to use to rotate an image about a point that is not the image's center point using MATLAB?
回答1:
Two rotations of the same angle are equal up to a translation. So you can just do rotation around the center, and then translate the image to put your own center of rotation at its old position.
回答2:
The help to 'rotate' says:
ROTATE Rotate objects about specified origin and direction. ROTATE(H,[THETA PHI],ALPHA) rotates the objects with handles H through angle ALPHA about an axis described by the 2-element direction vector [THETA PHI] (spherical coordinates).
All the angles are in degrees. The handles in H must be children of the same axes....
ROTATE(...,ORIGIN) uses the point ORIGIN = [x0,y0,y0] as the center of rotation instead of the center of the plot box.
回答3:
To rotate about a point other than the origin you:
- Translate the point you want to rotate around to the origin. For example, if you want to rotate around (3,5), you would translate by (-3,-5).
- Perform your rotation.
- Undo the initial translation. So in my example you would now translate by (+3,+5).
来源:https://stackoverflow.com/questions/10026905/how-to-rotate-an-image-about-a-point-that-is-not-the-images-center-point-using