how can I rotate an image about an arbitrary point in that image
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Robert Gengelbach
le 8 Mai 2018
Commenté : Rik
le 18 Juin 2020
how can I rotate an image about an arbitrary point in that image
Réponse acceptée
Srinath Tankasala
le 18 Mai 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).
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 commentaire
Rik
le 18 Juin 2020
What if the rotation point is not an interger pixel location? This will introduce error
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!