MATLAB图像插值法123学习日记--interp2函数

matlab提供的是interp2函数由于实现图像的插值,主要的五种插值的基本方法都在这里啦。

话不多说,其他详细可以help帮助文档,直接上代码

load flujet.mat %加载图像
colormap gray   %颜色图灰色即为灰度图

V = single(X(200:300,1:25));
%隔离图像的一小部分并将其投射为单精度。
subplot(231);
imagesc(V);%显示原始图片
title('Original Image')
Vq2 = interp2(V,2);
%通过在每个维度中将精制网格的点之间的间隔重复划分两次来插入内插值。

subplot(232);
imagesc(Vq2);%显示插值后的图片
% 放大倍数为2
title('Linear Interpolation')

subplot(233);
Vq3= interp2(V,3);
imagesc(Vq3);%显示三次插值后的图片
title('Cubic linear interpolation')

subplot(234);
Vq4= interp2(V,2,'linear');
imagesc(Vq4);%显示双线性内插值后的图片
title('Bilinear interpolation')

subplot(235);
Vq5= interp2(V,2,'spline');
imagesc(Vq5);%显示三次样条插值的图片
title('Cubic spline interpolation');

subplot(236);
Vq6= interp2(V,2,'cubic');
imagesc(Vq6);%显示三次方插值法,当数据有均匀间隔适用,否则与spline等效
title('Cubic interpolation');

效果如下:

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

海宝7号

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值