how can I rotate an image about an arbitrary point in that image

14 visualizaciones (últimos 30 días)
how can I rotate an image about an arbitrary point in that image

Respuesta aceptada

Srinath Tankasala
Srinath Tankasala el 18 de Mayo de 2018
The ability to rotate an image around a point is not available directly in MATLAB.
However, to work around this issue, rotating an image around a point is possible by first zero-padding the image (calculating how many rows and columns to pad to create a "virtual center"), rotating around its center (using "imrotate"), and then cropping to remove the initial padding ("un-pad" the image).
There is a File exchange submission that performs this rotation using the above methodology.
Download this file and add it to MATLAB's path before use. The provided example in the function's help documentation works fine:
imshow(rotateAround(imread('eight.tif'), 1, 1, 10));
  1 comentario
Rik
Rik el 18 de Jun. de 2020
Comment posted as answer by Mustafa Emresoy:
What if the rotation point is not an interger pixel location? This will introduce error

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by