フィルターのクリア

rotate a tif image

3 ビュー (過去 30 日間)
Busy Bee
Busy Bee 2018 年 2 月 7 日
編集済み: Guillaume 2018 年 2 月 8 日
I have a tif image which I need to rotate by an angle theta keeping the cg and coordinate axes constant.(i have attached my .tif image). In the example given below, i have rotated the image by 45 degree anticlockwise but it is getting distorted and the cg is also moving. Any help is appreciated.
to
  8 件のコメント
Busy Bee
Busy Bee 2018 年 2 月 7 日
Rotating the polygon whose vertices are known around its centroid.
Jan
Jan 2018 年 2 月 7 日
@Busy Bee: Really? You have the coordinates of the vertices? (By the way: coordinates are not "known around a centroid") And you want to attach a TIF file? Why not providing the positions as code?

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

採用された回答

Guillaume
Guillaume 2018 年 2 月 7 日
編集済み: Guillaume 2018 年 2 月 8 日
"Rotating the polygon whose vertices are known around its centroid."
Not sure why a tif image was mentioned then.
Assuming you're on R2017b or later:
polygon = polyshape(vertices); %vertices is a Nx2 matrix of points
[centroidx, centroidy] = centroid(polygon);
rotated_polygon = rotate(polygon, angle, [centroidx centroidy]);
plot([polygon rotated_polygon])

その他の回答 (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