版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、matlab综合课程设计扌艮告设计题目:专 业班 级 学 生指导教师 刘庆2016年春季学期设计任务:题目:功能:0要求:。第一部分(20%)第一部分(20%)第三部分(30%)第四部分(30%)报告成绩:指导教师:预习报告(20%):平时成绩(10%):验收答辩成绩(50%):设计报告成绩(20%):总评成绩:一、总体设计1. 程序的总体设计处理后文件均原图加噪图欢迎使用原女磁据原本函数处理结果二、功能实现1.(流程图)三、测试及调试(测试方案、存在的问题及解决方法)2. 详细描述程序编写的步骤及编写过程中出现的问题;3. 详细描述程序测试方案,采用的调试方法及调试手段;4. 详细描述调试中
2、出现的问题、对问题的分析及解决方法。四、总结包括但不限于以下内容:5. 对matlab知识的掌握程度;6. 对程序设计方法(自顶向下、结构化设计)的体会和掌握程度;7. 分析问题和解决问题的能力,并举例说明;8. 建议与意见。附件:主要源程序代码(需打印)附件一:一维信号滤波高斯滤波:瘩高斯滤波的代码x=0:2 047;a=load ( ' data . txt' ) ;%运彳亍h寸 data . txt 文件耍放至u当而 h 习七(current directory)中gau= 0.0009 0.0175 0.1295 0.3521 0.3521 0.1295 0.0175
3、0.0009汽标准羞 为1时的高斯函数一维模板,如果标准差不为1,则要修改模板y=conv(a,gau);y=y (1:length(y)-length(gau)+1);figure;subplot(1,2,1);plot(x,a);xlabel ('高斯滤波前的序列');subplot(1,2,2) ;plot(xz y);xlabel (高斯滤波后的序列');%高斯函数的一维模板可以由这个函数得到:fspecial ( 'gaussian' #1 n f sigma)%当标准差sigma是某一固定数字时,存在一个n,对于任意的n>=n,模板都一
4、样中值滤波:function y=yiweimid(x,n)mz n=size(x);xin = zeros(1,n);for i=l:1:n-nq = median(x(1,i+n);xin (1, i+n) =q;endy=xin;end咎中值滤波的代码:x=0:2047;a=load ( ' data . txt1 ) ;%运行11 寸 date . txt 文件要放至u当前 h录(current directory)中n=5; % n为模板长度,tfi可以改变y = medfiltl(a,n);figure;subplot(1,2,1);plot(x,a);xlabel (-中
5、值滤波前的序列1 );subplot(1,2,2);plot(x,y); xlabel (,中值滤波后的序列1 );均值滤波:function y=yiweijun(x,n)m,n=size(x);xin = zeros(1,n);for i=l:1:n-nq = sum(x(1z i+n)/(n+l);xin(1,i+n/2)=q;endy = xin;end务均值滤波的代码:x=0:2047;a=load ( ' data . txt1 ) ;%运行时 data. txt 文件要放至ij、"l前冃录(currentdirectory)中n=5; % n为模板长度,值可以改
6、变mean = ones (lzn) . /n; %mean为1 xn的模板,各数组元素的值均为1/n y = conv(a,mean);y=y(1:length(y)-length(mean)+1);figure;subplot(1,2,1);plot(x,a);xlabel ('均值滤波前的序列');subplot(1,2,2);plot(x,y);xlabel ('均值滤波后的序列');高斯滤波:function d = gaussfilt(s) row,col=size(s);k=l ;n=mean(mean(s);img = double(s);nl
7、= floor(n+l)/2);%n2 = floor(col + 1)/2);for i= 1:nfor j =1:nb (i,j) = exp(-(i-nl)x2+(j-nl)x2)/(4*k)/(4*pi*k);endendimgl=conv2(img,b, 1 same 1);d=uint8(imgl);end中值滤波:function y = midfilter(x,n)row,col = size(x);xl = double(x);x2 =xl;for i = 1:row-n+1for j = 1:row-n+1c = xl(i:i+(n-1)z j:j+(n-1);e =c (
8、lz:);for u = 2:ne =e,c(u,:);endmm =median(e);x2(i+(n-l)/2,j+(n-l)/2) = mm; endendy = uint8(x2);end均值滤波:function y = midjunzhi(x,n)row,col = size(x);xl = double(x);x2 =xl;for i = 1:row-n+1for j = 1:rowc = xl(i:i+(n-l),j:j+(n-l);e =c (lz:);for u = 2:ne = e,c (u,:);endmm =sum(e)/(n*n);x2(i+(n-1)/2,j+(n
9、-1)/2) = mm; endend附件三:二维信号滤波算法的改进中值滤波改进算法:function y = midfiltergaij in(x,n)row,col = size(x);xl = double(x);x2 =xl;for i = 1:row-n+1for j = 1:row-n+1c = xl(i:i+(n-1),j:j+(n-1);e =c (1,:);for u = 2:ne =e,c(u,:);endif( x2(i+(n-l)/2/j+(n-l)/2)=max(e)|x2 (i+ (n-1)/2,j+(n-1)/2)=min(e)mm =median(e);x2(i
10、+(n-l)/2zj+(n-l)/2) = mm;elsex2 (i+ (n-1) /2 , j + (n-1) /2) =x2 (i+ (n-1) /2 z j + (n-1) /2);endendy = uint8(x2);end均值滤波改进算法:function y = midjunzhigaijin(x,n)瘩一种改进的均值滤波算法row,col = size(x);xl = double(x);x2 =xl;for i = 1:row-n+1for j = 1:row-n+1c = xl(i:i+(n-1)z j:j+(n-1);e =c (lz:);for u = 2:ne =e,
11、c(u,:);endif( x2(i+(n-l)/2 f j+(n-1)/2)=max(e) | |x2(i+(n-1)/2,j+(n-1)/2)=min(e)mm =sum(e)/(n*n);x2(i+(n/2,j+/2) = mm;elsex2 (i+ (n-1) /2z j+ (n-1) /2) =x2 (i+ (n-1) /2z j+ (n-1) /2); endend end y = uint8(x2);endgui界面程序:function varargout = untitled(varargin) gui_singleton = 1;gui statestruct(1gui_n
12、ame1,1gui_singleton1zmfilename, gui_singleton,.gui_openingfcn1,unt i tled_openingfcn z.unt i t led_ou tiput fen,);1gui_outputfcn1,1gui_layoutfcn1,'gui_callback', if nargin && ischar(varargin1)gui_state.gui_callback = str2func(varargin1); end if nargoutvarargout1:nargout = gui_mainfcn
13、(gui_state, varargin:); elsegui_mainfcn(gui_state, varargin:);end% end initialization code - do not edi% executes just before untitled is made visible.function untitled_openingfcn(hobject, eventdata, handles, varargin)% choose default command line output for untitled handlesoutput = hobject;% update
14、 handles structureguidata(hobject, handles);% outputs from this function are returned to the command line.function varargout = untitled_outputfcn(hobject, eventdata, handles) % get default command line output from handles structure varargout1 = handlesoutput;% executes on button press in togglebutto
15、nl.function togglebuttonl_callback(hobject, eventdata, handles)% executes on selection change in popupmenul.function popupmenul_cal1back(hobject, eventdata, handles)% executes during object creation, after setting all properties.function popupmenul_createfcn(hobject, eventdata, handles)if ispc &
16、& isequal(get(hobject, 'backgroundcolor 1),get (0, 1 defaultuicontrolbackgroundcolor1 )set(hobj ect, 'backgroundcolor1, 1 white 1);end% executes on button press in radiobuttonlfunctionfunctionfunctionfunctionfunctionfunctionradiobuttonl_callback(hobject, eventdata, handles)untitled_l_cal
17、lback(hobj ect,untitled_2_callback(hobj ect,untitled_3_callback(hobj ect,untitled_6_callback(hobject,untitled_7_callback(hobj ect,eventdata,eventdata,eventdata,eventdata,eventdata,handles)handles)handles)handles)handles)functionuntitled_10_callback(hobject, eventdata, handles) global yy; %str = get(
18、hobj ect, 1 string 1); axes(handles-axes2); gyil = gaosiyi(yy,3); imshow(gyil);axes(handles.axes3); gyi2 = medfilt2(yy); imshow(gyi2); function untitled_ll_callback(hobject, eventdata, handles) global j iaoyan;%str = get(hobj ect, 1 string1);axes(handles.axes2);gaosil = gaussfilt(jiaoyan);imshow(gao
19、sil);axes(handles.axes3); row,col=size(j iaoyan);n=floor(mean(mean(j iaoyan);gaosi22=fspecial(1gaussian1,3,1);gaosi2 = filter2(gaosi22,j iaoyan)/255;imshow(gaosi2);function untitled_8_callback(hobject, eventdata, handles) global yy;%str = get(hobj ect z 1 string 1);axes(handles.axes2);junyil = yiwei
20、jun(yy,3);imshow(j unyi1);axes(handles-axes3);junyi2 = medfilt2(yy);imshow(j unyi2);function untitled_9_callback(hobject, eventdata, global img;global j iaoyan;%str = get(hobj ect z 1 string 1);axes(handles.axes2);erjunl = midjunzhi(jiaoyan,3);imshow(erj uni);axes(handles.axes3);junmo = fspecial(1 a
21、verage 1,3);erjun2 = filter2(j unmo,j iaoyan)/255;imshow(erj un2);function untitled_4_callback(hobject, eventdata,global yy;%str = get(hobj ect, 1 string 1);axes(handlesaxes2);midyil = yiweimid(yy,3);imshow(midyil);axes(handles.axes3);midyi2 = medfilt2(yy);imshow(midyi2);function untitled_5_callback
22、(hobject, eventdata, function untitled_12_callback(hobject, eventdata, global j iaoyan;%str = get(hobj ect, 1 string 1);axes(handlesaxes2);ermidl = midfilter(jiaoyan,3);imshow(ermidl);axes(handles.axes3);ermid2 = medfilt2(jiaoyan);imshow(ermid2);function untitled_13_callback(hobject, eventdata, glob
23、al img;handles)handles)handles)handles)handles)filename,pathname=.uigetfile(1 * jpg1;,*bmp 1;1 * gif 1);str= pathname filename;img = imread(str);axes(handles axesl);imshow(img);function untitled_14_callback(hobject, eventdata, handles) filename pathname = uigetfile(1 *.xlsx1);str= filename pathname;
24、datal = xlsread(str);set(handles.listboxl, 1 string 1,datal);handles.data = data;guidata(hobjects.handles);function untitled_15_callback(hobject, eventdata, handles) clcclear all;close(gcf);function figurel_resizefcn(hobject, eventdata, handles) function 1istboxl_callback(hobject, eventdata, handles
25、) function listboxl_createfcn(hobject, eventdata, handles) if ispc && isequal(get(hobject, 1 backgroundcolor 1), get(0, 1 defaultuicontrolbackgroundcolor1)set(hobj ect, 1 backgroundcolor1, 1 white 1);endfunction untitled_16_callback(hobject, eventdata, handles) function untitled_17_callback(
26、hobject, eventdataz handles) o be defined in a future version of matlabglobal img;global yy;axes(handles.axes5);dy=0l*rand(size(img);yy=y+dy;plot(x,yy);function untitled_18_callback(hobject, eventdata, handles) global img;global j iaoyan;axes(handles-axes5);gaosi = imnoise(img,1gaussian1,0.02);j iaoyan = gaosi;imshow(gaosi);function untitled_19_callback(hobject, eventdata, handles) global img;global j iaoyan;axes(handles.axes5);jiaoyan
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年短视频内容创作者生态研究报告
- 基于学科融合与素养导向的初中一年级地理“地球的运动”单元整体教学设计
- 人教版三年级上册数学单元教学计划
- 体育水平三“蹲踞式跳远”单元教学计划教学设计及教案
- 《大学生创新创业教育》教案
- 爱国主义教育主题班会教案
- 小学四年级语文语音教学专项计划
- 幼小协同科学衔接学前教育宣传月活动总结
- 2026年吉林省省直事业单位公开选拔招聘工作人员(10号)考前冲刺密卷附答案详解【培优A卷】
- 2026河北大学建筑工程学院公开招聘教学助理1名笔试题库(达标题)附答案详解
- 2026年泌尿外科出科试卷及答案
- 2026小学数学北师大版新教材培训:四至六年级教材解析
- 2026广西正远监理咨询有限公司第二批项目制用工招聘47人笔试模拟试题及答案详解
- 现代(HYUNDAI)N300系列变频器使用说明书
- 人际交往与人际沟通
- 彩钢板房安装合同
- JBT 1255-2014 滚动轴承 高碳铬轴承钢零件热处理技术条件
- 上海市小升初英语单词表
- 《预算绩效管理》课件
- GMP制药专业英语词汇
- 道德与法治初中新课程标准测试题(含答案)
评论
0/150
提交评论