Rotate an image without having a deformation
조회 수: 2 (최근 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:
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!