function varargout = pjimage(varargin)
% PJIMAGE M-file 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 07-Jun-2014 21:26:56
% 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)
% 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);
setappdata(handles.figure_pjimage,'img_src',0);%%0表示全局句柄
% 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 m_file_open_Callback(hObject, eventdata, handles)
% 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)
msgbox('具体联系Q609553134,0定金')
%setappdata(handles.figure_pjimage,'img_src',img_src);
% --------------------------------------------------------------------
function m_file_save_Callback(hObject, eventdata, handles)
% 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)
img_src=getappdata(handles.figure_pjimage,'img_src');
[filename,pathname]=uiputfile('*.bmp');%%保存
if isequal(filename,0)||isequal(pathname,0)
return;
else
fpath=fullfile(pathname,filename);
end
% --------------------------------------------------------------------
function m_file_exit_Callback(hObject, eventdata, handles)
% 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)
close(handles.figure_pjimage)
% --------------------------------------------------------------------
function image_chuli_Callback(hObject, eventdata, handles)
% hObject handle to image_chuli (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function image_chuli_huidu_Callback(hObject, eventdata, handles)
% hObject handle to image_chuli_huidu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
x=rgb2gray(img_src);
imshow(x);
title('灰度变换后图片')
% --------------------------------------------------------------------
function image_chuli_erzhi_Callback(hObject, eventdata, handles)
% hObject handle to image_chuli_erzhi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
msgbox('Q609553134')
% --------------------------------------------------------------------
function image_chul_xuanzhuan_Callback(hObject, eventdata, handles)
% hObject handle to image_chul_xuanzhuan (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
W=imrotate(img_src,180,'crop');
imshow(W);
title('旋转180后的图片')
% --------------------------------------------------------------------
function image_chuli_jianqie_Callback(hObject, eventdata, handles)
% hObject handle to image_chuli_jianqie (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
I=imcrop(img_src);
imshow(I);
title('剪切图片');
% --------------------------------------------------------------------
function image_chul_ruihua_Callback(hObject, eventdata, handles)
% hObject handle to image_chul_ruihua (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
K=rgb2gray(img_src);
H=fspecial('laplacian');
M=filter2(H,K);
imshow(M)
title('锐化后的图片')
% --------------------------------------------------------------------
function image__Callback(hObject, eventdata, handles)
% hObject handle to image_ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function image_FFT_Callback(hObject, eventdata, handles)
% hObject handle to image_FFT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
FFT=fft2(img_src);%%%二维傅里叶变换
imshow(FFT);
title('FFT变换后的图片');
% --------------------------------------------------------------------
function image_DCT_Callback(hObject, eventdata, handles)
% hObject handle to image_DCT (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global img_src
axes(handles.axes_dst);
I=rgb2gray(img_src);
K=dct2(I);
imshow(K);
title('DCT变换后的图片')
% -------------------------------------------------------------