Rotate image about a specified pixel coordinate
3 views (last 30 days)
Does anyone know of a way to rotate an image about a specified pixel coordinate? If I have the pixel coordinates (50,55) for example, I would like the end result to be centred around (50,55)... So the centre pixel of the rotated image is equivalent to these coordinates.
I have tried imrotate, but cannot get it to rotate on a specified coordinate.
Rick Rosson on 29 Sep 2011
I think you can accomplish what you want by following a two-step process. First, rotate the image through the desired angle. I believe this will rotate the image about the origin. Then, translate the image by the desired amount in both directions.
Julien GANCE on 20 Jan 2012
I tried to use the imtransform function to do that but the part of the picture that is cropped during the first translation is lost so that when I translate back the picture, I get a black area on the final one. Do you have an idea on the function to use ?