简单数字图像处理系统(共9页).doc
《简单数字图像处理系统(共9页).doc》由会员分享,可在线阅读,更多相关《简单数字图像处理系统(共9页).doc(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上数字图像课程设计 简单数字图像处理系统function varargout = untitled(varargin)% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, untitled_OpeningFcn, . gui_OutputFcn, untitled_OutputFcn, . gui_LayoutFcn, , . g
2、ui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - Executes just before untitled is made visible.function
3、 untitled_OpeningFcn(hObject, eventdata, handles, varargin) %界面初始化函数setappdata(handles.figure1,I,0); % 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 GUIDA
4、TA)% varargin command line arguments to untitled (see VARARGIN) % Choose default command line output for untitledhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes untitled wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from thi
5、s function are returned to the command line.function varargout = untitled_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% handles structure wit
6、h handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % -function m_file_Callback(hObject, eventdata, handles)% hObject handle to m_file (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structur
7、e with handles and user data (see GUIDATA) % -function my_file_open_Callback(hObject, eventdata, handles)global I;FileName,PathName = uigetfile(*.bmp;*.jpg;*.tiff;*.gif);%弹出对话框得到打开的路径I=imread(strcat(PathName,FileName);%打开得到的路径下的文件imshow(I)setappdata(handles.figure1,I,I);% handles structure with hand
8、les and user data (see GUIDATA) % -function my_file_save_Callback(hObject, eventdata, handles)global I;%这个是要保存的东西,一般是global的FileName,PathName = uiputfile(*.bmp;*.jpg;*.tiff;*.gif);%弹出对话框的到保存的路径imwrite(I,strcat(PathName,FileName);%存储到该路径下%uigetfile Open standard dialog box for retrieving files%saveas
9、(figure_handle,filename,fileformat)%saveas(gcf,picname,jpg) %if isequal(filename,0)|isequal(pathname,0) % return; %如果点了取消%else % fpath=fullfile(pathname,filename); %获取全路径的另一种方法%end %I=getappdata(handles.figure1,I);%imwrite(I,fpath); %保存图片 % -function my_file_exit_Callback(hObject, eventdata, handles
10、)close(handles.figure1); %退出% hObject handle to my_file_exit (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function my_file_print_Callback(hObject, eventdata, handles)% hObject handle to my_file_print (see
11、GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)C:UsersswjDocumentsMATLABuntitled.fig % -function m_image_Callback(hObject, eventdata, handles)% hObject handle to m_image (see GCBO)% eventdata reserved - to be defined
12、 in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function m_image_2bw_Callback(hObject, eventdata, handles)% hObject handle to m_image_2bw (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and use
13、r data (see GUIDATA) % -function m_image_tongji_Callback(hObject, eventdata, handles)%图像直方图的统计与绘制 直方图反应灰度值与像素个数的关系%FileName,PathName = uigetfile(*.bmp;*.jpg;*.tiff;*.gif);%弹出对话框得到打开的路径%I=imread(strcat(PathName,FileName);%打开得到的路径下的文件global I;A = rgb2gray(I); %将真彩色图像转换为灰度图像%figure(Name, 显示灰度图像)subplot
14、(2,2,1);imshow(I);title(原图);%imshow(A);J,I = histeq(A);%imshow(J);subplot(2,2,2);imhist(A,64); %提取图像中的直方图信息title(直方图的统计);%BW= bwperim(A,8);%figure(name,周长)%imshow(BW); % -function m_image_mianji_Callback(hObject, eventdata, handles)global I;BW = bwperim(im2bw(I); %显示二值化后的图像 Area = bwarea(BW) labeled
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 简单 数字图像 处理 系统
限制150内