数字图像处理-降噪滤波-大作业26页

上传人:文库****9 文档编号:170690929 上传时间:2021-03-03 格式:DOC 页数:26 大小:2.38MB
返回 下载 相关 举报
数字图像处理-降噪滤波-大作业26页_第1页
第1页 / 共26页
数字图像处理-降噪滤波-大作业26页_第2页
第2页 / 共26页
数字图像处理-降噪滤波-大作业26页_第3页
第3页 / 共26页
数字图像处理-降噪滤波-大作业26页_第4页
第4页 / 共26页
数字图像处理-降噪滤波-大作业26页_第5页
第5页 / 共26页
点击查看更多>>
资源描述

《数字图像处理-降噪滤波-大作业26页》由会员分享,可在线阅读,更多相关《数字图像处理-降噪滤波-大作业26页(26页珍藏版)》请在金锄头文库上搜索。

1、昆明理工大学信息工程与自动化学院学生实验报告( 20152016学年 第 一 学期 )课程名称:图形图像基础程序设计 开课实验室: 2015年 12月 1 日年级、专业、班物联网131学号201310410133姓名李哲成绩实验项目名称图像综合处理指导教师毛存礼教师评语 教师签名: 年 月 日一、实验目的及内容目的:掌握和熟悉Matlab编程环境及语言;掌握图像降噪算法和用途。内容:在课程教学和查阅相关文献资料的基础上,选择下面一个数字图像处理技术专题,实现相应算法进行仿真实验,并完成大作业报告。专题如下:(1) 图像增强处理技术;(2) 图像降噪处理技术。2、题目分析 利用matlab的GU

2、I程序设计一个简单实用的图像处理程序。该程序应具备图像处理的常用功能,以满足用户的使用。现设计程序有以下基本功能:1)图像的读取和保存。2)通过自己输入数值,实现图像的旋转。3)图像直方图统计和直方图均衡,要求显示直方图统计,比较直方图均衡后的效果。4)能对图像加入各种噪声,5)并通过几种滤波算法实现去噪并显示结果。6)将图像转化成灰度图像。3.总体设计软件的总体设计界面布局如上图所示分为显示区域与操作区域。上边为显示区域:显示载入原图,以及通过处理后的图像。操作区域:通过功能键实现对图像的各种处理。设计完成后运行的软件界面如下:4、具体设计现介绍各个功能模块的功能与实现。4.1图像的读取和保

3、存: (1)利用matlab中 “ uigetfile”、“imread” “imshow”实现图像文件的读取与显示:实现代码:function pushbutton2_Callback(hObject, eventdata, handles)% hObject handle to pushbutton2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)filename,p

4、athname=uigetfile(*.jpg;*.bmp;*.tif;*.*,载入图像);if isequal(filename,0)|isequal(pathname,0) errordlg(没有选中文件,出错); return;else file=pathname,filename; global S %设置一个全局变量S,保存初始图像路径,以便之后的还原操作 S=file; x=imread(file); set(handles.axes1,HandleVisibility,ON); axes(handles.axes1); imshow(x); set(handles.axes1,H

5、andleVisibility,OFF); axes(handles.axes2); imshow(x); handles.img=x; guidata(hObject,handles);end % - Executes on button press in pushbutton4.function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version o

6、f MATLAB% handles structure with handles and user data (see GUIDATA) sfilename ,sfilepath=uiputfile(*.jpg;*.bmp;*.tif;*.*,保存图像文件,untitled.jpg); if isequal(sfilename,sfilepath,0,0) sfilefullname=sfilepath ,sfilename; imwrite(handles.img,sfilefullname); else msgbox(你按了取消键,保存失败); end(2)图像保存。利用uiputfile

7、和imwrite函数实现图像文件的保存。实现代码:function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) sfilename ,sfilepath=uiputfile(*.jpg;*.bmp;*.tif

8、;*.*,保存图像文件,untitled.jpg); if isequal(sfilename,sfilepath,0,0) sfilefullname=sfilepath ,sfilename; imwrite(handles.img,sfilefullname); else msgbox(你按了取消键,保存失败); end3) 程序的退出。实现代码: function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved

9、- to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)clc;close all;close(gcf);clear;4.2图像转化为灰度图像因为matlab中较多的图像处理函数支持对灰度图像进行处理,故对图像进行灰度转化十分必要。利用rgb2gray(X)函数对其他图像进行灰度图像的转化。实现代码:function pushbutton11_Callback(hObject, eventdata, handles)% hObject han

10、dle to pushbutton11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Taxes(handles.axes2);T=getimage;x=rgb2gray(handles.img); %RGB?imshow(x);handles.img=x;guidata(hObject,handles);4.3图像直方图统计和直方图均衡(1)通过histe

11、q(X)函数实现直方图均衡。此函数只能对灰度图像进行直方图均衡所以要先将彩图转为灰度图像。实现代码:function pushbutton12_Callback(hObject, eventdata, handles)% hObject handle to pushbutton12 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Taxes(handles.a

12、xes2);T=getimage;h=histeq(handles.img); imshow(h);handles.img=h;guidata(hObject,handles); (2) 直方图统计。通过利用imhist(X)函数来实现直方图统计。实现代码:function pushbutton13_Callback(hObject, eventdata, handles)% hObject handle to pushbutton13 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% h

13、andles structure with handles and user data (see GUIDATA)axes(handles.axes2);x=imhist(handles.img); %直方图统计x1=x(1:10:256);horz=1:10:256;bar(horz,x1);axis(0 255 0 15000);set(handles.axes2,xtick,0:50:255);set(handles.axes2,ytick,0:2000:15000); 4.4加入各种噪声,并通过几种滤波算法实现去噪(1)加入噪声。通过imnoise(I,type,parameters)

14、来加入各种噪声。加入椒盐噪声实现代码:function pushbutton6_Callback(hObject, eventdata, handles)% hObject handle to pushbutton6 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Taxes(handles.axes2);T=getimage; prompt=数日椒盐噪声参数1:; defans=0.02

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

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