数字图像处理-降噪滤波-大作业要点_第1页
数字图像处理-降噪滤波-大作业要点_第2页
数字图像处理-降噪滤波-大作业要点_第3页
数字图像处理-降噪滤波-大作业要点_第4页
数字图像处理-降噪滤波-大作业要点_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

昆明理工大学信息工程自动化学院学生实验报告(2015-2016学年第一学期)课程名称:图形影像基础程式设计课程:2015年12月1日年级、专业、课物联网131学号3名字李哲成绩实验项目名称图像综合处理指导教师毛汇款式教师的意见教师签名:年月日一、实验目的和内容目标:掌握和熟悉Matlab编程环境和语言。了解图像降噪算法和用途。内容:在课程教学和相关文献复习的基础上,选择下一个数字图像处理技术主题,实施相应的算法进行模拟实验,制作大的工作报告。主题如下:(1)图像增强处理技术;(2)图像降噪处理技术。2、主题分析使用Matlab的GUI程序设计简单实用的图像处理程序。此程序必须具有用于用户用途的图像处理的一般功能。设计过程具有以下基本功能:1)读取和保存图像。2)直接输入数值以实现图像的旋转。3)要求直方图统计和直方图均衡化,显示直方图统计,比较直方图均衡化后的效果。4)可以向图像中添加各种杂点5)和多个过滤算法消除噪声并显示结果。6)将图像转换为灰度图像。3.整体设计软件的总体设计界面布局如上图所示分为显示区域和操作区域。顶部显示区域:显示已加载的源和已处理的图像。工作区:通过功能键实现图像的各种处理。设计完成后,运行的软件界面如下:4、具体设计现在介绍了每个功能模块的功能和实现。4.1读取和保存图像:(1)在MATLAB中使用“uigetfile”、“im read”和“im show”读取和显示图像文件:实施代码:function push but 2 _ callback(h object,event data,handles)% h object handle to push button 2(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)filename,pathname=ui getfile (* .jpg* .bmp* .tif* .*,加载图像);If is equal (filename,0) | is equal (pathname,0)Errordlg(未选择文件,出现错误);ReturnElseFile=pathname,filename;设置全局S%全局变量S,然后保存初始映像路径以执行后续还原操作S=fileX=im read(文件);Set (handles.axes 1,handle visibility,on);axes(handles . axes 1);im show(x);Set (handles.axes 1,handle visibility,off);axes(handles . axes 2);im show(x);handles . img=x;Guiddata (h object,handles);End% -按钮按压上的按钮4。function push button 4 _ callback(h object,event data,handles)% h object handle to push button 4(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)s filename,sfilepath=ui putfile (* .jpg* .bmp* .tif* .*,保存图像文件,untitled . jpg);If is equal (s filename,sfilepath,0,0)Sfilefullname=sfilepath,s filename;Im write (handles.img,sfile full name);ElseMsgbox(按取消键保存失败);End(2)保存图像。使用Uiputfile和imwrite函数保存图像文件。实施代码:function push button 4 _ callback(h object,event data,handles)% h object handle to push button 4(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)s filename,sfilepath=ui putfile (* .jpg* .bmp* .tif* .*,保存图像文件,untitled . jpg);If is equal (s filename,sfilepath,0,0)Sfilefullname=sfilepath,s filename;Im write (handles.img,sfile full name);ElseMsgbox(按取消键保存失败);End3)退出计划。实施代码:function push button 5 _ callback(h object,event data,handles)% h object handle to push button 5(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)ClcClose all关闭(GCF);Clear4.2将图像转换为灰度图像由于Matlab具有更多支持灰度图像处理的图像处理功能,因此需要对图像进行灰度转换。使用Rgb 2灰色(x)函数转换其他图像的灰度图像。实施代码:function push button 11 _ callback(h object,event data,handles)% h object handle to push button 11(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)全球taxes(handles . axes 2);T=getimagex=RGB 2g ray(handles . img);%RGB?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?-嗯?im show(x);handles . img=x;Guiddata (h object,handles);4.3图像直方图统计和直方图均衡化(1)通过histeq(X)函数实现直方图均衡化。此函数只能对灰度图像执行直方图均衡化,因此,首先将颜色映射转换为灰度图像。实施代码:function push button 12 _ callback(h object,event data,handles)% h object handle to push button 12(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)全球taxes(handles . axes 2);T=getimageh=histeq(handles . img);IMS how(h);handles . img=h;Guiddata (h object,handles);(2)直方图统计。直方图统计信息是利用imhist(X)函数实现的。实施代码:function push button 13 _ callback(h object,event data,handles)% h object handle to push button 13(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)axes(handles . axes 2);x=im hist(handles . img);%直方图统计信息x1=x1=x(1336010:256);Horz=1:10:256Bar(horz,x1);axis(0 255 0 15000);Set (handles.axes 2,x刻度,03336905033605255);Set (handles.axes 2,y刻度,0333690200:0000);4.4添加各种噪波,并通过多种过滤算法消除噪波(1)添加噪波。通过Imnoise(I,type,parameters)添加各种噪波。添加椒盐噪声实施代码:function push button 6 _ callback(h object,event data,handles)% h object handle to push button 6(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)全球taxes(handles . axes 2);T=getimagePrompt=几天椒盐噪声参数1: ;defans= 0.02 ;P=inputdlg (prompt,input,1,defans);P1=str 2 num(p 1 );F=im noise (handles.img,salt pepper,P1);IMS how(f);handles . img=f;Guiddata (h object,handles);添加高斯噪波:实施代码:function push button 10 _ callback(h object,event data,handles)% h object handle to push button 10(see gcbo)% event data reserved-to be defined in a future version of MATLAB% handles structure with handles and user data(see guiddata)全球taxes(handles . axes 2);T=getimagePrompt=输入高斯噪声1:输入高斯噪声2 ;Defans=0,0.02 ;P=inputdlg (prompt,input,1,defans);P1=str 2 num(p 1 );p2=str 2 num(p 2 );F=im noise (handles.img,高斯,P1,p2);IMS how(f);handles . img=f;Guiddata (h object,handles);添加乘法噪音:

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论