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

14 ビュー (過去 30 日間)
Robert Gengelbach
Robert Gengelbach 2018 年 5 月 8 日
コメント済み: Rik 2020 年 6 月 18 日
how can I rotate an image about an arbitrary point in that image

採用された回答

Srinath Tankasala
Srinath Tankasala 2018 年 5 月 18 日
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 件のコメント
Rik
Rik 2020 年 6 月 18 日
Comment posted as answer by Mustafa Emresoy:
What if the rotation point is not an interger pixel location? This will introduce error

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by