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

内插是在放大、收缩、旋转和几何校正等任务中广泛应用的基本工具。

最近邻内插法(nearest): 原图像中寻找最接近的像素,并把该像素的灰度赋给新像素。

双线性内插法(bilinear):用4个最近邻去估计给定位置的灰度。(最实用)

v(x, y) = ax + by + cxy + d;

v(x, y)灰度值; a,b,c,d通过四个最近邻点求得。

双三次内插法(bicubic):用16个最近邻点赋予给定位置的灰度值.(商业图像编辑程序的标准内插方法).(数字图像处理(P37))

v(x, y) = ∑∑aijxiyj

v(x, y)灰度值; 0≤i≤3; 0≤j≤3; aij通过四个最近邻点求得。

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')

 

处理结果:

 

 

相关链接:http://blog.csdn.net/zhengxiaoyang995926/article/details/79375254

转载于:https://www.cnblogs.com/MrZheng9511/p/MrZheng.html

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值