MATLAB(GUI)数字像处理实验报告

上传人:qiuji****ngye 文档编号:36736797 上传时间:2018-04-01 格式:DOCX 页数:36 大小:7.34MB
返回 下载 相关 举报
MATLAB(GUI)数字像处理实验报告_第1页
第1页 / 共36页
MATLAB(GUI)数字像处理实验报告_第2页
第2页 / 共36页
MATLAB(GUI)数字像处理实验报告_第3页
第3页 / 共36页
MATLAB(GUI)数字像处理实验报告_第4页
第4页 / 共36页
MATLAB(GUI)数字像处理实验报告_第5页
第5页 / 共36页
点击查看更多>>
资源描述

《MATLAB(GUI)数字像处理实验报告》由会员分享,可在线阅读,更多相关《MATLAB(GUI)数字像处理实验报告(36页珍藏版)》请在金锄头文库上搜索。

1、20122013 学年第二学期学年第二学期课程名称:教学实践课程名称:教学实践:软硬件提高训练软硬件提高训练任课教师:任课教师: 题题 目:目:MATLAB 数字像处理数字像处理学号:学号:ROB12023姓名:姓名: 年级:年级:2012 级级专业:自动化专业:自动化提交日期: 年 月 日评语:评语:成绩:成绩: 评卷人:评卷人:1.1.设计目的设计目的利用 MATLAB 的 GUI 程序设计一个简单实用的像处理程序。该程序应具备像处理的常用功能,以满足要求。2.2.设计要求设计要求设计程序有以下基本功能:1)像的读取、保存和程序退出2)像转化为灰度像3)底片处理(反)4)截5)亮度和对比度

2、度调节6)像的翻转与旋转7)添加噪声8)平滑和锐化9)直方均衡化处理10)像的腐蚀和膨胀11)边缘检测12)还原和撤销3.3.总体设计总体设计4.4.程序与运行结果程序与运行结果4.1 像的读取、保存和程序退出1像读取1)主要程序A=imread(str) %读取片imshow(A) %显示片2)运行结果2像保存1)主要程序imwrite(handles.img,sfilefullname); %像的保存2)运行结果3退出1)主要程序close all; %关闭所有 2)运行结果(略)4.2 像转化为灰度像1)主要程序C=rgb2gray(img); %将 rgb 彩像转换为灰度2)运行结果4

3、.3 底片处理(反)1)主要程序I=imcomplement(handles.img); %底片处理(反)2)运行结果4.4 截1)主要程序a=imcrop(handles.img); %像的截取2)运行结果4.5 亮度和对比度度调节1亮度调节1)主要程序y=imadjust(handles.img, , ,p1); %亮度调节2)运行结果2对比度调节1)主要程序f=immultiply(handles.img,p1); %对比度增强f=imdivide(handles.img,p1); %对比度减弱2)运行结果4.6 像的翻转与旋转1像的翻转1)主要程序fliplr(b) %像的翻转2)运行

4、结果2像的旋转1)主要程序f=imrotate(handles.img,p1,bilinear,crop); %像的旋转2)运行结果4.7 添加噪声1椒盐噪声1)主要程序f=imnoise(handles.img,salt %添加椒盐噪声2)运行结果2高斯噪声1)主要程序f=imnoise(handles.img,gaussian,p1,p2); %添加高斯噪声2)运行结果3乘法噪声1)主要程序f=imnoise(handles.img,speckle,p1); %添加乘法噪声2)运行结果4.8 平滑和锐化1平滑1)主要程序Imfilter % 均值滤波medfilt2 % 中值滤波2)运行结

5、果2锐化1)主要程序fspecial( ) %创建预定义的滤波算子imfilter( );imadd( ); %在实现卷积运算的基础上进行滤波2)运行结果4.9 直方均衡化处理1灰度像1)主要程序B=histeq(C); %直方均衡化函数2)运行结果2RGB 像1)主要程序B=histeq(C); %直方均衡化函数2)运行结果4.10 像的腐蚀和膨胀1像的腐蚀1)主要程序I1=imerode(handles.img,se); %像的腐蚀2)运行结果2像的膨胀1)主要程序I1=imdilate(handles.img,se); %像的膨胀2)运行结果4.11 边缘检测 1)主要程序rslt=yc

6、bcr2rgb(uint8(img2); %边缘检测2)运行结果4.12 还原和撤销1还原1)主要程序global S %设计一个全局变量 S,保存初始像路径,以便之后的还原操作 2)运行结果2撤销(只能撤销一次)1)主要程序global T %设计一个全局变量 S,保存每次操作原像,以便撤销操作 2)运行结果5心得体会通过用()设计数字像处理界面,我掌握了有关数字像处理的相关知识和的操作知识,让理论知识与实际相结合,做出了数字像处理的形用户界面。在实践前,通过一天的数字像处理的相关知识与一天的知识的学习,掌握了其基本入门知识;然后在实践中,结合要设计要求补充自学相关知识,在实践中验证理论知识

7、,充实理论知识,加强动手能力;在实践后,总结实践过程,撰写实验报告,再次加深所学知识。6.附录代码(带注释) function varargout = dazouyematlab(varargin) %DAZOUYEMATLAB M-file for dazouyematlab.fig % DAZOUYEMATLAB, by itself, creates a new DAZOUYEMATLAB or raises the existing % singleton*. % % H = DAZOUYEMATLAB returns the handle to a new DAZOUYEMATLAB

8、 or the handle to % the existing singleton*. % % DAZOUYEMATLAB(Property,Value,.) creates a new DAZOUYEMATLAB using the % given property value pairs. Unrecognized properties are passed via % varargin to dazouyematlab_OpeningFcn. This calling syntax produces a % warning when there is an existing singl

9、eton*. % % DAZOUYEMATLAB(CALLBACK) and DAZOUYEMATLAB(CALLBACK,hObject,.) call the % local function named CALLBACK in DAZOUYEMATLAB.M with the given input % arguments. % % *See GUI Options on GUIDEs Tools menu. Choose “GUI allows only one % instance to run (singleton)“. % % See also: GUIDE, GUIDATA,

10、GUIHANDLES% Edit the above text to modify the response to help dazouyematlab% Last Modified by GUIDE v2.5 18-Jul-2014 11:52:53% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct(gui_Name, mfilename, .gui_Singleton, gui_Singleton, .gui_OpeningFcn, dazouyematlab_OpeningFcn,

11、 .gui_OutputFcn, dazouyematlab_OutputFcn, .gui_LayoutFcn, , .gui_Callback, ); if nargin endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:); elsegui_mainfcn(gui_State, varargin:); end % End initialization code - DO NOT EDIT% - Executes just before dazouyematlab is made visible. funct

12、ion dazouyematlab_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin unrecognized Pr

13、opertyName/PropertyValue pairs from the % command line (see VARARGIN)% Choose default command line output for dazouyematlab handles.output = hObject;% Update handles structure guidata(hObject, handles);% UIWAIT makes dazouyematlab wait for user response (see UIRESUME) % uiwait(handles.figure1);% - O

14、utputs from this function are returned to the command line. function varargout = dazouyematlab_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % hand

15、les structure with handles and user data (see GUIDATA)% Get default command line output from handles structure varargout1 = handles.output;% - Executes on button press in pushbutton14. function pushbutton14_Callback(hObject, eventdata, handles)%退出退出 % hObject handle to pushbutton14 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUID

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

当前位置:首页 > 行业资料 > 其它行业文档

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