Rotate binary object around its centroid

Hi, I have a small problem. I am trying to rotate image in 2D but around custom axis. I mean, I have a centroid of binary object and now I want to rotate it but around that centroid point. Can somebody help me?

 採用された回答

Image Analyst
Image Analyst 2017 年 3 月 24 日

1 投票

Try using imtranslate() or circshift() to shift the centroid to the middle, then call imrotate(), then shift back to the original location. Otherwise, just use the rotation matrix (see Wikipedia).

1 件のコメント

Stachu Suchar
Stachu Suchar 2017 年 3 月 24 日
Ok, thank you for the answer!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および 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