1、数字图像处理matlabGUI处理包function varargout = digital_image_processing(varargin)% DIGITAL_IMAGE_PROCESSING MATLAB code for digital_image_processing.fig% DIGITAL_IMAGE_PROCESSING, by itself, creates a new DIGITAL_IMAGE_PROCESSING or raises the existing% singleton*.% H = DIGITAL_IMAGE_PROCESSING returns the
2、handle to a new DIGITAL_IMAGE_PROCESSING or the handle to% the existing singleton*.% DIGITAL_IMAGE_PROCESSING(CALLBACK,hObject,eventData,handles,.) calls the local% function named CALLBACK in DIGITAL_IMAGE_PROCESSING.M with the given input arguments.% DIGITAL_IMAGE_PROCESSING(Property,Value,.) creat
3、es a new DIGITAL_IMAGE_PROCESSING or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before digital_image_processing_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed t
4、o digital_image_processing_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only one% instance to run (singleton).% See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help digital_image_processing % Last Modified by GUIDE v2.5 21-No
5、v-2017 14:07:42 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, digital_image_processing_OpeningFcn, . gui_OutputFcn, digital_image_processing_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargi
6、n & 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 digital_image_processing is made visible.function digita
7、l_image_processing_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 command line argume
8、nts to digital_image_processing (see VARARGIN) % Choose default command line output for digital_image_processinghandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes digital_image_processing wait for user response (see UIRESUME)% uiwait(handles.figure1); % - O
9、utputs from this function are returned to the command line.function varargout = digital_image_processing_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 MATLA
10、B% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % - Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventd
11、ata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,String) returns popupmenu1 contents as cell array% contentsget(hObject,Value) returns selected item from popupmenu1 % - Executes during objct
12、 creation, after setting all properties.function popupmenu1_CreateFcn(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: popupmenu contr
13、ols usually have a white background on Windows.% See ISPC and COMPUTER.if ispc & isequal(get(hObject,BackgroundColor), get(0,defaultUicontrolBackgroundColor) set(hObject,BackgroundColor,white);end % -function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)%
14、eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_3_Callback(hObject, eventdata, handles)% hObject handle to Untitled_3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handle
15、s structure with handles and user data (see GUIDATA) % -function Untitled_14_Callback(hObject, eventdata, handles)% hObject handle to Untitled_14 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untit
16、led_25_Callback(hObject, eventdata, handles)% hObject handle to Untitled_25 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_29_Callback(hObject, eventdata, handles)% hObject handle to Untitl
17、ed_29 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_32_Callback(hObject, eventdata, handles)% hObject handle to Untitled_32 (see GCBO)% eventdata reserved - to be defined in a future versi
18、on of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_33_Callback(hObject, eventdata, handles)% hObject handle to Untitled_33 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDAT
19、A)I = handles.img ;c = 222 272 300 270 221 194;r = 21 21 75 121 121 75;BW = roipoly(I,c,r);H = fspecial(unsharp);J = roifilt2(H,I,BW);figure, imshow(I);figure,imshow(J); handles.img = I;guidata(hObject,handles); % -function Untitled_34_Callback(hObject, eventdata, handles)% hObject handle to Untitle
20、d_34 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)I = handles.img ;c = 222 272 300 270 221 194;r = 21 21 75 121 121 75;J = roifill(I,c,r); figure, imshow(I);title();figure,imshow(J);title();handles.img = I;gui
21、data(hObject,handles); % -%function Untitled_30_Callback(, eventdata, handles)% hObject handle to Untitled_30 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % f = zeros(30,30);% f(5:24,13:17) = 1;% axes(handles
22、.dispaly1);% imshow(f,InitialMagnification,fit);% imwrite(f,file.jpg); f = handles.img ; F = fft2(f,256,256);F1 = fftshift(F);F2 =log(abs(F1);axes(handles.display2);imshow(F2,),title(); handles.img = img;guidata(hObject,handles); % -function Untitled_31_Callback(hObject, eventdata, handles)% hObject
23、 handle to Untitled_31 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)RGB = handles.img ;% I = rgb2gray(RGB);J= dct2(RGB);figure;imshow(log(abs(J),);title(DCT);colormap(gray(4);colorbar J(abs(J)0.01) = 0;K = idc
24、t2(J);axes(handles.display2);imshow(K);title(DCT); handles.img = RGB;guidata(hObject,handles); % -%function Untitled_26_Callback(hObject, eventdata, handles)% hObject handle to Untitled_26 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles an
25、d user data (see GUIDATA)I = handles.img ;J = imnoise(I,salt & pepper,0.02);figure,imshow(J);K = filter2(fspecial(average,3),J)/255;figure,imshow(K);title();handles.img = I;guidata(hObject,handles); % -%function Untitled_27_Callback(hObject, eventdata, handles)% hObject handle to Untitled_27 (see GC
26、BO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)I = handles.img ;J = imnoise(I,salt & pepper,0.02);figure,imshow(J);L= medfilt2(J,3 3);figure,imshow(L);title();handles.img = I;guidata(hObject,handles); % -% function Unt
27、itled_28_Callback(hObject, eventdata, handles)% hObject handle to Untitled_28 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)I = handles.img ;J = imnoise(I,gaussian,0,0.025);figure,imshow(J);L= wiener2(J,5 5);figure,imshow(L);title();handles.img = I;guidata(hObject,handles); % -
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2