function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED('Property','Value',...) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_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
% Edit the above text to modify the response to help untitled
% Last Modified by GUIDE v2.5 30-Aug-2016 12:36:12
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @untitled_OpeningFcn, ...
'gui_OutputFcn', @untitled_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 untitled is made visible.
function untitled_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 untitled (see VARARGIN)
% Choose default command line output for untitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this 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 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)
[filename,pathname]=uigetfile({'*.*';'*.bmp';'*.jpg';'*.tif';'*.jpg'},'选择图像');
if isequal(filename,0)||isequal(pathname,0)
errordlg('您还没有选取图片!!','温馨提示');%如果没有输入,则创建错误对话框
return;
else
image=[pathname,filename];%合成路径+文件名
im1=imread(image);%读取图像
set(handles.axes1,'HandleVisibility','ON');%打开坐标,方便操作
axes(handles.axes1);%%使用图像,操作在坐标1
imshow(im1);%在坐标axes1显示原图像
end
handles.img = im1; %将图片赋值于句柄
guidata(hObject, handles);%更新句柄
% --- 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 im2;
im2 = rgb2gray(handles.img);
axes(handles.axes1);%%使用图像,操作在坐标1
imshow(im2);%在坐标axes2显示原图像
handles.img = im2; %将图片赋值于句柄
guidata(hObject, handles);%更新句柄
set(handles.text1,'String','灰度图像显示');
im3=imhist(handles.img);
axes(handles.axes2);%%使用图像,操作在坐标2
bar(im3);
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
axes(handles.axes3);%%使用图像,操作在坐标3
set(handles.text3,'String','均衡化直方图');
im4 = histeq(handles.img);
bar(im4);
axes(handles.axes2);%%使用图像,操作在坐标2
imshow(im4);
set(handles.text2,'String','均衡化灰度图');
% --- Executes on button press in pushbutton6.
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)
set(handles.axes1,'HandleVisibility','ON');%打开坐标,方便操作
axes(handles.axes3);%%使用图像,操作在坐标3
global im2;
imshow(liner(im2,120));
set(handles.text3,'String','线性变换图');
% --- 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 of MATLAB
% handles structure with handles and user data (see GUIDATA)
global im2;
axes(handles.axes3);%%使用图像,操作在坐标3
imshow(nonliner1(im2,2));
set(handles.text3,'String','对数变换图');
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global im2;
axes(handles.axes2);%%使用图像,操作在坐标2
imshow(nonliner2(im2,1));
set(handles.text2,'String','指数变换图');
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close;
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global im2;
im=imnoise(im2,'salt & pepper',0.1);
imshow(im);
set(handles.text2,'String','椒盐噪声图像');
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
i=str2double(get(hObject,'string'));
if isnan(i)
set(hObject, 'String', 0);
errordlg('Input must be a number','Error');
end
global im2;
axes(handles.axes3);%%使用图像,操作在坐标3
imN=imnoise(im2,'salt & pepper',i);
imshow(imN);
set(handles.text3,'String','噪声信号控制');
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls 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
% --- Executes on button press in pushbutton10.
function pushbutton
Image-Processing.rar_椒盐噪声
版权申诉
137 浏览量
2022-07-15
11:41:46
上传
评论
收藏 23KB RAR 举报
alvarocfc
- 粉丝: 112
- 资源: 1万+
最新资源
- CBDL进行性能监控.rar
- BookStore.zip
- 数据库管理工具:dbeaver-ce-23.0.4-stable.x86-64.rpm
- Delphi 12 控件之DEV 改升级到D12.txt
- 数据库管理工具:dbeaver-ce-23.0.4-macos-x86-64.dmg
- 油猴儿crx扩展程序文件(Tampermonkey)
- 数据库管理工具:dbeaver-ce-23.0.4-macos-aarch64.dmg
- Python爬虫的基础知识、实例和反爬机制
- 数据库管理工具:dbeaver-ce-23.0.3-stable.x86-64.rpm
- 外部中断0计数数码管显示0-9.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈