function varargout = pjimage(varargin)
% PJIMAGE MATLAB code for pjimage.fig
% PJIMAGE, by itself, creates a new PJIMAGE or raises the existing
% singleton*.
%
% H = PJIMAGE returns the handle to a new PJIMAGE or the handle to
% the existing singleton*.
%
% PJIMAGE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PJIMAGE.M with the given input arguments.
%
% PJIMAGE('Property','Value',...) creates a new PJIMAGE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before pjimage_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to pjimage_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 pjimage
% Last Modified by GUIDE v2.5 29-Jun-2018 09:01:23
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @pjimage_OpeningFcn, ...
'gui_OutputFcn', @pjimage_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 pjimage is made visible.
function pjimage_OpeningFcn(hObject, eventdata, handles, varargin)
setappdata(handles.figure_pjimage,'img_src',0);
set(handles.img,'Enable','off'); %不打开图片,就不能使用“图像处理”菜单中的命令
set(handles.m_Image_Smoothing,'Enable','off');
set(handles.Arithmetic_operation,'Enable','off');
set(handles.tuxiangzengqiang,'Enable','off');
setappdata(handles.figure_pjimage,'bSave',false);
setappdata(handles.figure_pjimage,'bChanged',false);
% 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 pjimage (see VARARGIN)
% Choose default command line output for pjimage
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes pjimage wait for user response (see UIRESUME)
% uiwait(handles.figure_pjimage);
% --- Outputs from this function are returned to the command line.
function varargout = pjimage_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 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 structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function img_Callback(hObject, eventdata, handles)
% hObject handle to img (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_image_2bw_Callback(hObject, eventdata, handles)
h=im2bw_args;
setappdata(handles.figure_pjimage,'bChanged',true);
% hObject handle to m_image_2bw (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_image_gammatrans_Callback(hObject, eventdata, handles)
h=toGamma;
setappdata(handles.figure_pjimage,'bChanged',true);
% hObject handle to m_image_gammatrans (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_image_LogTrans_Callback(hObject, eventdata, handles)
h = toLogTrans;
setappdata(handles.figure_pjimage,'bChanged',true);
% hObject handle to m_image_LogTrans (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_file_open_Callback(hObject, eventdata, handles)
[filename,pathname]=uigetfile(...
{'*.bmp;*.jpg;*.png;*.jpeg','Image Files(*.bmp,*.jpg,*.png,*.jpeg)';...
'*.*', 'All Files(*.*)'},...
'Pick an image');
if isequal(filename,0)||isequal(pathname,0),
return;
end
axes(handles.axes_src);%用axes命令设定当前操作的坐标轴是axes_src
fpath=[pathname filename];%将文件名和目录名组合成一个完整的路径
img_src=imread(fpath);imshow(img_src);%用imread读入图片,并用imshow在axes_src上显示
setappdata(handles.figure_pjimage,'img_src',img_src);
set(handles.img,'Enable','on'); %不打开图片,就不能使用“图像处理”菜单中的命令
set(handles.m_Image_Smoothing,'Enable','on');
set(handles.Arithmetic_operation,'Enable','on');
set(handles.tuxiangzengqiang,'Enable','on');
% hObject handle to m_file_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_file_save_Callback(hObject, eventdata, handles)
img_dst=getimage(handles.axes_dst);
imwrite(img_dst,'new.bmp');
% hObject handle to m_file_save (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_file_save_as_Callback(hObject, eventdata, handles)
[filename,pathname]=uiputfile({'*.bmp','BMP files';'*.jpg;','JPG files'},'Pick an Image');
if isequal(filename,0)||isequal(pathname,0)
return;%如果点了“取消”
else
fpath=fullfile(pathname, filename);%获得全路径的另一种方法
end
img_dst=getimage(handles.axes_dst);
imwrite(img_dst,fpath);
setappdata(handles.figure_pjimage,'bSave',true);
% hObject handle to m_file_save_as (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function m_file_exit_Callback(hObject, eventdata, handles)
h=findobj('Tag','figure_im2bw');%查找是否打开设置图像二值化参数窗口
if ~isempty(h),%找到的话,则关闭
close(h);
end
h=findobj('Tag','figure_toGamma');%查找是否打开设置图像gamma数值窗口
if ~isempty(h),%找到的话,则关闭
close(h);
end
h=findobj('Tag','figure_toLog');%查找是否打开设置图像gamma数值窗口
if ~isempty(h),%找到的话,则关闭
close(h);
end
h=findobj('Tag','figure_milv');%查找是否打开设置图像gamma数值窗口
if ~isempty(h),%找到的话,则关闭
close(h);
end
close(findobj('Tag','figure_pjimage'));%关闭主窗口
% hObject handle to m_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 tbl_open_ClickedCallback(hObject, eventdata, handles)
feval(@m_file_open_Cal
matlab image GUI.rar_GUI_completexr1_matlab_图像处理_图像处理 GUI
版权申诉
27 浏览量
2022-07-15
08:03:17
上传
评论
收藏 128KB RAR 举报
四散
- 粉丝: 52
- 资源: 1万+
最新资源
- HTML+CSS制作的个人博客网页.zip
- IMG_20240521_094903.jpg
- 基于htmlde 爱心代码,但HTML网页源码.zip
- 51单片机实现LED流水灯
- 基于Python的obEspoir分布式游戏框架设计源码
- 基于python的机械设计实用计算器,可计算电动机,传动装置,V带轮,齿轮,轴,轴承的几何或者力,运动学参数数值+源码+开发文档
- 基于HTML +JavaScript的元旦倒计时代码.docx
- 【Unity资源免费分享】孩子益智小游戏unity 5x系列Baby Doll House Cleaning
- 【资源免费分享】集市游戏(uniyt案例)
- 数据整理结果 2023-12-7 192544 6.dta
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈