Rotate image about a specified pixel coordinate

4 visualizaciones (últimos 30 días)
Philip
Philip el 29 de Sept. de 2011
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.

Respuestas (2)

Rick Rosson
Rick Rosson el 29 de Sept. de 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.
HTH.
Rick
  1 comentario
Walter Roberson
Walter Roberson el 29 de Sept. de 2011
Shouldn't it be three-step? Translate the image so that (50,55) gets centered over (0,0), then do the rotation, and then translate back ?

Iniciar sesión para comentar.


Julien GANCE
Julien GANCE el 20 de En. de 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 ?
Thanks
Julien
  1 comentario
Image Analyst
Image Analyst el 20 de En. de 2012
Of course. You're going to have to figure out how large you need to make your canvass (prior to rotation) if you don't want any part of your image to be cropped. In other words, use padarray() to put a large margin of black around your image before rotating it so that the "good" part of your image will always lie within the output image.

Iniciar sesión para comentar.

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by