用matlab实现双线性插值旋转图像程序

上传人:ji****n 文档编号:44977132 上传时间:2018-06-14 格式:DOC 页数:4 大小:40.50KB
返回 下载 相关 举报
用matlab实现双线性插值旋转图像程序_第1页
第1页 / 共4页
用matlab实现双线性插值旋转图像程序_第2页
第2页 / 共4页
用matlab实现双线性插值旋转图像程序_第3页
第3页 / 共4页
用matlab实现双线性插值旋转图像程序_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《用matlab实现双线性插值旋转图像程序》由会员分享,可在线阅读,更多相关《用matlab实现双线性插值旋转图像程序(4页珍藏版)》请在金锄头文库上搜索。

1、用 matlab 实现双线性插值旋转图像程序 2008 年 11 月 06 日 星期四 19:13 用 matlab 实现双线性插值旋转图像程序 2008-04-27 1 2:51 双线性插值: 输出像素值是它在输入图像中 2*2 邻域采样点的平均值,它根 据某像素周围 4 个像素的灰度值在水平和垂直两个方法上对其插值。为了方便 理解,先考虑一维情况下的线性插值:对于一个数列 c,假设 ca到 ca+1之 间是线性变化的,那么对于浮点数 x(a 1 y = floor( t(2) );v1 = im( x + 1, y, : ) * ( t(1) - x ) + im( x, y, : ) *

2、 ( 1 + x - t(1) );v2 = im( x + 1, y + 1, : ) * ( t(1) - x ) + im( x, y + 1, : ) * ( 1 + x - t(1) );v = v2 * ( t(2) - y ) + v1 * ( 1 + y - t(2) );imN( r, c, : ) = round(v);endend end imN = uint8(imN); subplot(1,2,2); imshow(imN);出处:http:/ 50 350 450,.name,实例 86); h1=axes(parent,h0,.position,0.10 0.45

3、 0.8 0.5,.visible,off); x=0:0.2:2*pi; y=sin(x); plot(x,y) b1=uicontrol(parent,h0,.units,points,.tag,b1,.style,pushbutton,.string,三次样条插值,.backgroundcolor,0.75 0.75 0.75,.position,20 60 70 20,.callback,.y=0,.sy=0,.strn1=get(e2,string);,.n1=str2num(strn1);,.strn2=get(e3,string);,.n2=str2num(strn2);,.x=

4、n1:0.2:n2;,.i=1;,.for t=n1:0.2:n2,.y(i)=sin(t);,.sy(i)=san(t,n1,n2);,.i=i+1;,.end,.plot(x,y,b*,x,sy,r-),.axis(0 7 -1.5 1.5),.legend(sin(x),N-Hermite 插值); b2=uicontrol(parent,h0,.units,points,.tag,b2,.style,pushbutton,.string,误差比较,.backgroundcolor,0.75 0.75 0.75,.position,170 60 70 20,.callback,.strd

5、n1=get(e2,string);,.n1=str2num(strdn1);,.strdn2=get(e3,string);,.n2=str2num(strdn2);,.strdn=get(e1,string);,.dn=str2num(strdn);,.dd=abs(sin(dn)-san(dn,n1,n2);,.msgbox(误差为:,num2str(dd),计算结果); e1=uicontrol(parent,h0,.units,points,.tag,e1,.style,edit,.fontsize,12,.string,1.20,.horizontalalignment,right

6、,.backgroundcolor,1 1 1,.position,200 100 40 20); t1=uicontrol(parent,h0,.units,points,.tag,t1,.style,text,.string,误差点:,.fontsize,12,.backgroundcolor,0.75 0.75 0.75,.position,160 100 40 20); e2=uicontrol(parent,h0,.units,points,.tag,e2,.style,edit,.fontsize,12,.string,1.00,.horizontalalignment,right

7、,.backgroundcolor,1 1 1,.position,20 85 40 20); t2=uicontrol(parent,h0,.units,points,.tag,t2,.style,text,.string,第一节点:,.fontsize,12,.backgroundcolor,0.75 0.75 0.75,.position,15 105 50 20); e3=uicontrol(parent,h0,.units,points,.tag,e3,.style,edit,.fontsize,12,.string,3.00,.horizontalalignment,right,.

8、backgroundcolor,1 1 1,.position,100 85 40 20); t3=uicontrol(parent,h0,.units,points,.tag,t3,.style,text,.string,第二节点:,.fontsize,12,.backgroundcolor,0.75 0.75 0.75,.position,95 105 50 20); b3=uicontrol(parent,h0,.units,points,.tag,b3,.style,pushbutton,.string,关闭,.backgroundcolor,0.75 0.75 0.75,.position,100 20 60 20,.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号