매트랩에서 이미지를 회전시키는 방법

매트랩에서 이미지를 회전시키는 방법

방법

imrotate(I,angle,method,bbox)

X = phantom('Modified Shepp-Logan',64);
 
figure()
imagesc(X)
title('X')
 
Y1=imrotate(X,30,'nearest','crop');
Y2=imrotate(X,30,'bilinear','crop');
Y3=imrotate(X,30,'bicubic','crop');

figure()
subplot(1,3,1)
imagesc(Y1)
title('Y1 - nearest')

subplot(1,3,2)
imagesc(Y2)
title('Y2 - bilinear')

subplot(1,3,3)
imagesc(Y3)
title('Y3 - bicubic')

1.png

3.png

X = phantom('Modified Shepp-Logan',64);
 
figure()
imagesc(X)
title('X - 64*64')
 
Y1=imrotate(X,30,'nearest','loose');
Y2=imrotate(X,30,'nearest','crop');

figure()
subplot(1,2,1)
imagesc(Y1)
title('Y1 - loose 88*88')

subplot(1,2,2)
imagesc(Y2)
title('Y2 - crop 64*64')

1.png

타언어

댓글