Rotate an image without having a deformation
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to rotate an image by X degrees using imrotate. But if X isn't equal to 90 or -90, the image will be deformed. An example:
![0 degree.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201928/0%20degree.png)
![18 degrees.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/201929/18%20degrees.png)
Is there any another solution?
0 个评论
采纳的回答
更多回答(1 个)
DGM
2022-12-1
From the documentation:
B = imrotate(A,ANGLE,METHOD,BBOX) rotates image A, where BBOX specifies
the size of the output image B. BBOX is a text string that can have
either of the following values. The default value is enclosed in braces
({}).
{'loose'} Make output image B large enough to contain the
entire rotated image. B is generally larger than A.
'crop' Make output image B the same size as the input image
A, cropping the rotated image to fit.
In other words, the default behavior does not crop the image. If the image is being cropped, it's either because you're cropping it, or it's because you're not using imrotate().
A = imread('cameraman.tif');
B = imrotate(A,20); % default behavior
imshow(B) % no cropping
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!