function varargout = Image_GUI(varargin)
% IMAGE_GUI MATLAB code for Image_GUI.fig
% IMAGE_GUI, by itself, creates a new IMAGE_GUI or raises the existing
% singleton*.
%
% H = IMAGE_GUI returns the handle to a new IMAGE_GUI or the handle to
% the existing singleton*.
%
% IMAGE_GUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in IMAGE_GUI.M with the given input arguments.
%
% IMAGE_GUI('Property','Value',...) creates a new IMAGE_GUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Image_GUI_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Image_GUI_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 Image_GUI
% Last Modified by GUIDE v2.5 25-Oct-2019 15:18:43
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Image_GUI_OpeningFcn, ...
'gui_OutputFcn', @Image_GUI_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 Image_GUI is made visible.
function Image_GUI_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 Image_GUI (see VARARGIN)
% Choose default command line output for Image_GUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
movegui(gcf,'center');
t=timer('executionmode','fixedrate','period',1,'TimerFcn',{@onTimer,handles});
start(t);
function onTimer(hObject, eventdata, handles)
% hObject handle to time (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
xingqi={'日','一','二','三','四','五','六'};
set(handles.time,'string',[datestr(now,'yyyy mm dd HH:MM:SS') ' 星期' xingqi{weekday(now)}]);
% --- Outputs from this function are returned to the command line.
function varargout = Image_GUI_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;
%% --------------------------------------------------------------开始------------------------------------------------------------
function start_Callback(hObject, eventdata, handles)
% hObject handle to start (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% ---------------打开-----------------------------------------------------
function open_Callback(hObject, eventdata, handles)
% hObject handle to open (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({'*.*';'*.png';'*.jpg';'*.bmp';'*.tif'},'载入图像');
if isequal(filename,0)||isequal(pathname,0)
%errordlg('没有打开文件!','error');
return;
else
file=[pathname,filename];
global S %设置一个全局变量,保存初始图像路径,便于还原
S=file;
I=imread(file);
axes(handles.axes1);%将Tag值为axes1的坐标轴置为当前
cla reset%清除原有内容
imshow(I);
axes(handles.axes2);%将Tag值为axes2的坐标轴置为当前
cla reset
imshow(I);
clear T map PSF;
end
% --------------储存------------------------------------------------------
function save_Callback(hObject, eventdata, handles)
% hObject handle to save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global T
[sfilename,spathname]=uiputfile({'*.jpg';'*.png';'*.bmp';'*.tif';'*.*'},'储存图像');
if ~isequal([sfilename,spathname],[0,0])
sfilefullname=[spathname sfilename];%获得全路径的另一种方法
axes(handles.axes2);
T=getimage;%获得坐标轴2的图像信息,存入T
imwrite(T,sfilefullname);
else
% errordlg('没有储存图像!','error');
return
end
% --------------撤销------------------------------------------------------
function repeal_Callback(hObject, eventdata, handles)
% hObject handle to repeal (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global T;
axes(handles.axes2);
imshow(T);
% --------------初始化------------------------------------------------------
function initialize_Callback(hObject, eventdata, handles)
% hObject handle to initialize (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global S;
clear T map PSF;
axes(handles.axes1);
imshow(S);
axes(handles.axes2);
cla reset
imshow(S);
% --------------------------------------------------------------------
function print_Callback(hObject, eventdata, handles)
% hObject handle to print (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global T;
axes(handles.axes2);
T=getimage;
printpreview
% --------------关闭------------------------------------------------------
function close_Callback(hObject, eventdata, handles)
% hObject handle to close (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
B=questdlg('确认关闭数字图形处理演示系统?','提示','Yes','No','Yes')
switch B
case 'Yes'
close(gcf);
clear all;
clc;
end
% ---------------------查看-----------------------------------------------
function whos_Callback(hObject, eventdata, handles)
% hObject handle to whos (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global T
axes(handles.axes1);
T=getimage;
i=T;
axes(handles.axes2);
whos i
% imfinfo(T);
%% -----------------------------------------------图像类型变换-------------------------------------------------------
function transformation_Callback(hObject, eventdata, handles)
% hObject handle to transformation (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Im2bw_Callback(hObject, eventdata, handles)
% hObject handle to Im2bw (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global T
axes(handles.axes2);
T=getimage;
% if isrgb(T)==1
I=rgb2gray(T);
% else
% I=T;
% end
%thresh=graythresh(I);
bw=im2bw(I,0.6);
imshow(bw);
% --------------------------------------------------------------------
function RGB2gray_Callback(hObject, eventdata, handles)
% hObject handle to RGB2gray (see GCBO)
% eventdata reserved - to be defin
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
txcl.zip (38个子文件)
daima
Image_GUI.asv 85KB
Image_GUI.fig 92KB
1.jpg 19KB
IMG1
IMG
8.tif 197KB
4.tif 290KB
2.jpg 119KB
71.tif 254KB
9.tif 256KB
1.jpg 40KB
12.jpg 55KB
11.tif.tif 102KB
14.jpg 58KB
6.tif 245KB
66.bmp 669KB
10.tif 203KB
hdr_atrium.mat 3.45MB
13.tif 1MB
5.tif 65KB
67.bmp 155KB
47.BMP 77KB
7.tif 246KB
处理后图像
2.jpg 74KB
1.jpg 85KB
0.jpg 35KB
4.jpg 86KB
5.jpg 84KB
670.jpg 18KB
3.jpg 82KB
3.jpg 20KB
Image_GUI.m 85KB
IMG-2
ͼ3.tif 848KB
ͼ2.tif 102KB
ͼ6.tif 197KB
ͼ5.tif 203KB
ͼ7.tif 237KB
ͼ1.jpg 55KB
ͼ4.tif 249KB
dog.jpg 41KB
共 38 条
- 1
资源评论
路拾遗37
- 粉丝: 284
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功