フィルターのクリア

Resizing rotated image to be the flipped size of the original image

1 回表示 (過去 30 日間)
Jane
Jane 2013 年 12 月 16 日
編集済み: Image Analyst 2013 年 12 月 17 日
Hello, I'm trying to maintain the size of my image. You can see in this image, the rotated image is cut off. (i formed the original image with a freehand crop and rotated with 2d-2d rigid registration) How can I do this? Thanks

採用された回答

Matt J
Matt J 2013 年 12 月 16 日
編集済み: Matt J 2013 年 12 月 16 日
Since you presumably know the rotation angle, you can just repeat the rotation by using imrotate without cropping, e.g.,
imrotate(yourImage, angle)
or
imrotate(yourImage, angle,'loose')
  3 件のコメント
Matt J
Matt J 2013 年 12 月 17 日
I'm glad you've found a solution that pleases you, but that's not precisely what I meant. I meant that if you apply imrotate with the 'loose' option to the cropped image you've displayed for us on the left hand side, you will obtain the image exactly as it appears there, but rotated and with none of its original content truncated.
Image Analyst
Image Analyst 2013 年 12 月 17 日
編集済み: Image Analyst 2013 年 12 月 17 日
Plus, it doesn't maintain the size of the image like you (Jane) wanted (as I discussed in my answer) - the magnification is different.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2013 年 12 月 16 日
編集済み: Image Analyst 2013 年 12 月 16 日
The 'Loose' option prevents clipping.
rotatedImage = imrotate(originalImage, 90, 'loose');
To get it to appear the same size, you're going to have to set the 'Position' or 'OuterPosition' properties of the axes so that they don't automatically take up exactly 1/2 of the width. The wide one should be wider than the tall one, but that's not how subplot works - it just gives each image an equal size rectangle and changes the magnification of the image so that it will fit in that rectangle, which it sounds like is not what you want. A few minutes of playing around with the size properties did not reveal to me exactly how to do it.

カテゴリ

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