您的位置:首页 > 编程语言 > MATLAB

图像旋转-不同插值法比较——MATLAB

2017-06-19 18:49 183 查看
%不同插值法比较

clear all;

img = imread(‘g0.jpg’);

rotateimg1=imrotate(img,30,’nearest’);%最邻近插值

rotateimg2=imrotate(img,-30,’bilinear’);%双线性插值

rotateimg3=imrotate(img,50,’bicubic’);%三次插值

subplot(2,2,1),imshow(img);

title(‘orginal’);

subplot(2,2,2),imshow(rotateimg1);

title(‘nearest’);

subplot(2,2,3),imshow(rotateimg2);

title(‘bilinear’);

subplot(2,2,4),imshow(rotateimg3);

title(‘bicubic’);

处理结果:



当图像灰度有明显变化时,最邻近插值法的锯齿边较为明显,此时双线性插值法和三线性插值法能很好的保持图像的细节。相对于运算时间而言,三线性插值法花费的时间最长。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: