欢迎来到天天文库
浏览记录
ID:13126055
大小:531.00 KB
页数:10页
时间:2018-07-20
《数值计算方法实习报告1》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、数值计算方法实习报告实验一1、只留导电介质的数值模拟2、污染扩散问题的数值模拟实验二1、线性最小二乘的数据拟合2、非线性最小二乘的数据拟合以下是用有理函数和光滑样条对铜的热膨胀系数和温度进行拟合3.插值的数据拟合以下是用三次样条和简单函数拟合数据:x=0:0.05:2;y=x.*sin(1./(x+eps))相关代码:>>cftool>>loadhahn1>>x=0:0.05:2;>>y=x.*sin(1./(x+eps));结果如下:实习三基于偏微方程(PDE)的图像降噪和还原代码:%%%TVd
2、emo%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Basedon:[ROF92]L.Rudin,S.Osher,E.Fatemi,%"NonlinearTotalVariationbasednoiseremovalalgorithms",%PhysicaD60259-268,1992.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%SimpleTVdenoising%%%%%%%%%%%%%%%%%%%%
3、%%%%%%%%%%%%I=imread('1.jpg');%loadimageI=double(I(16:270,16:270));%cutapiece,converttodouble%paramsiter=80;%dt=0.2;eps=1;%%%Addnoisestd_n=20;%GaussiannoisestandarddeviationIn=randn(size(I))*std_n;%WhiteGaussiannoiseI0=I+In;%noisyinputimage%showorigin
4、alandnoisyimagescloseallfigure(1);imshow(uint8(I));title('Original')figure(2);imshow(uint8(I0));title('Noisyimage')%denoiseimagebyusingtvforsomeiterationsJ=tv(I0,iter);figure(3);imshow(uint8(J));title('Denoisedimage')%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%TV
5、denoisingwith(scalar)datafidelityterm%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Hereweassumethenoisevaianceisknown.%%Thereforewecancomputelambda(insteadoffixing%%iter).TVtherforecanrunautomaticallyquitewell.%%Theprocessisslower.J=I0;%paramsep_J=0.01;%minimumme
6、anchangeinimageJlam=0;J_old=0;iter=10;dt=0.2;eps=1;18var_n=std_n^2;%noisevariancei=0;while(mean(mean(abs(J-J_old)))>ep_J),%iterateuntilconvergenceJ_old=J;J=tv(J,iter,dt,eps,lam,I0);%scalarlamlam=calc_lam(J,I0,var_n,eps);%updatelambda(fidelityterm)end%
7、forifigure(4);imshow(uint8(J));title('Denoisedimagewithlambda')结果:修改前修改中修改结果
此文档下载收益归作者所有