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

Matlab 数字图像处理1---图像的收缩和放大

2018-02-26 12:17 681 查看
内插是在放大、收缩、旋转和几何校正等任务中广泛应用的基本工具。
最近邻内插法(nearest): 原图像中寻找最接近的像素,并把该像素的灰度赋给新像素。
双线性内插法(bilinear):用4个最近邻去估计给定位置的灰度。(最实用)v(x, y) = ax + by + cxy + d;v(x, y)灰度值,a,b,c,d通过四个最近邻点求得。
双三次内插法(bicubic):用16个最近邻点赋予给定位置的灰度值.(商业图像编辑程序的标准内插方法).(数字图像处理(P37))
Matlab Keyword: imresize
code:
Image_original = imread('D:\图像处理\image\rice1.jpg');
Image_shrink2_1 = imresize(Image_original,[128 128]);
Image_shrink2_2 = imresize(Image_original,0.5);
Image_enlarge2_nearest = imresize(Image_original,2,'nearest');
Image_enlarge2_bilinear = imresize(Image_original,2,'bilinear');
Image_enlarge2_bicubic = imresize(Image_original,2,'bicubic');
subplot(231)
imshow(Image_original)
title('Original')
subplot(232)
imshow(Image_shrink2_1)
title('Shrink 2 times_1')
subplot(233)
imshow(Image_shrink2_2)
title('Shrink 2 times_2')
subplot(234)
imshow(Image_enlarge2_nearest)
title('Enlarge 2 times.nearest')
subplot(235)
imshow(Image_enlarge2_bilinear)
title('Enlarge 2 times.bilinear')
subplot(236)
imshow(Image_enlarge2_bicubic)

title('Enlarge 2 times.bicubic')

处理结果:



相关链接: 点击打开链接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐