function varargout = enhancement(varargin)
% ENHANCEMENT M-file for enhancement.fig
% ENHANCEMENT, by itself, creates a new ENHANCEMENT or raises the existing
% singleton*.
%
% H = ENHANCEMENT returns the handle to a new ENHANCEMENT or the handle to
% the existing singleton*.
%
% ENHANCEMENT('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in ENHANCEMENT.M with the given input arguments.
%
% ENHANCEMENT('Property','Value',...) creates a new ENHANCEMENT or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before enhancement_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to enhancement_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help enhancement
% Last Modified by GUIDE v2.5 06-Jul-2009 14:40:11
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @enhancement_OpeningFcn, ...
'gui_OutputFcn', @enhancement_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before enhancement is made visible.
function enhancement_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 arguments to enhancement (see VARARGIN)
% Choose default command line output for enhancement
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes enhancement wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = enhancement_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 with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes2);
imshow(256);
% --- Executes on button press in pushbutton2.
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)
global im
[filename,pathname]=...
uigetfile({'*.tif';'*.jpg';'*.bmp';'*.gif';'*.*'},'choose the image');
if pathname == 0
return;
end
str=[pathname filename];
im=imread(str);
axes(handles.axes1);
imshow(im);
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu1
global im
str(1)={'pears'};
str(2)={'rose'};
str(3)={'point'};
str(4)={'circles'};
str(5)={'moon'};
str(6)={'alphabat'};
str(7)={'squares'};
popup_1=uicontrol('Style','popupmenu','Position',[2.8 23.308 20.2 1.692],...
'String',str,'Callback','popupmenu1_Callback')
index=get(hObject,'Value');
list=get(popup_1,'String');
listnum=list{index};
%axes(handles.axes1);
%set(findobj('Tag','text5'),'Visible','on');
switch listnum
case 'pears'
axes(handles.axes1);
im=imread('pears.tif');
%[A,map]=imread('pears.tif');
% save newfile A map
%handles.data=im;
imshow(im);
%guidata(hObject,handles);
case 'rose'
axes(handles.axes1);
im=imread('rose.tif');
[A,map]=imread('rose.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
case 'point'
axes(handles.axes1);
im=imread('point.tif');
[A,map]=imread('point.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
case 'circles'
axes(handles.axes1);
im=imread('circles.tif');
[A,map]=imread('circles.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
case 'moon'
axes(handles.axes1);
im=imread('moon.tif');
[A,map]=imread('moon.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
case 'alphabat'
axes(handles.axes1);
im=imread('alphabat.tif');
[A,map]=imread('alphabat.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
case 'squares'
axes(handles.axes1);
im=imread('squares.tif');
[A,map]=imread('squares.tif');
save newfile A map
handles.data=im;
imshow(im);
guidata(hObject,handles);
otherwise
msgbox('You have not select list index,Please select a list!','Information','non-modal')
end
% --- Executes during object 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 controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc
set(hObject,'BackgroundColor','white');
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
popup_noise_sel_index=get(handles.popupmenu2,'Value');
switch popup_noise_sel_index
case 1 %add gaussian noise
active.Visible='on';
set(handles.text9,active);
set(handles.text8,active);
active.String=' 0.0 ';
set(handles.edit1,active);
active.String='0.01';
set(handles.edit2,active);
active.Visible='off';
set(handles.text10,active)
set(handles.edit3,active);
case 2 %add additive noise
active.Visible='on';
set(handles.text9,active);
set(handles.text8,active);
active.String='0.04';
set(handles.edit1,active);
active.Strin
tuxiangzengqiang.zip_图像增强GUI
版权申诉
43 浏览量
2022-09-19
21:39:34
上传
评论
收藏 25KB ZIP 举报
alvarocfc
- 粉丝: 109
- 资源: 1万+
最新资源
- 海尔618算价表_七海5.20_16.00xlsx(1)(2).xlsx
- WebCrawler.scr
- 【计算机专业毕业设计】大学生就业信息管理系统设计源码.zip
- YOLO 数据集:8种路面缺陷病害检测【包含划分好的数据集、类别class文件、数据可视化脚本】
- JAVA实现Modbus RTU或Modbus TCPIP案例.zip
- 基于YOLOv8的FPS TPS AI自动锁定源码+使用步骤说明.zip
- JAVA实现Modbus RTU或Modbus TCPIP案例.zip
- 基于yolov8+streamlit的火灾检测部署源码+模型.zip
- 测试aaaaaaabbbbb
- VID20240521070643.mp4
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈