how to do inner rotation of image?

5 ビュー (過去 30 日間)
preet
preet 2013 年 12 月 8 日
回答済み: Walter Roberson 2013 年 12 月 8 日
for rotation i am using imrotate() function. padding is used in this rotation so size of image will increased this is the outer rotation but i need inner rotation without using increase the size of image.

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 12 月 8 日
Use the 'crop' option of imrotate() if it is acceptable to throw away the part of the image that does not fit within a horizontal / vertically aligned rectangle.
If you need the entire image to be preserved but without the border, then one way of doing it is to pad the image with NaN before rotating, and then for each rotation, locate the NaN and set those locations to be transparent in the Alpha parameter of image() or imshow()
Another approach is to create a hgtransform and parent the image to it, and then use makehgtransform to create the appropriate rotation matrix. This method does not use imrotate() at all, and does not require dealing with Alpha. This technique is best if you only need to display the rotated image, rather than needing to process the rotated image.

カテゴリ

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