function varargout = xiaobo_pinjie(varargin)
% XIAOBO_PINJIE MATLAB code for xiaobo_pinjie.fig
% XIAOBO_PINJIE, by itself, creates a new XIAOBO_PINJIE or raises the existing
% singleton*.
%
% H = XIAOBO_PINJIE returns the handle to a new XIAOBO_PINJIE or the handle to
% the existing singleton*.
%
% XIAOBO_PINJIE('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in XIAOBO_PINJIE.M with the given input arguments.
%
% XIAOBO_PINJIE('Property','Value',...) creates a new XIAOBO_PINJIE or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before xiaobo_pinjie_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to xiaobo_pinjie_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 xiaobo_pinjie
% Last Modified by GUIDE v2.5 24-Jan-2016 12:48:20
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @xiaobo_pinjie_OpeningFcn, ...
'gui_OutputFcn', @xiaobo_pinjie_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 xiaobo_pinjie is made visible.
function xiaobo_pinjie_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 xiaobo_pinjie (see VARARGIN)
% Choose default command line output for xiaobo_pinjie
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes xiaobo_pinjie wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = xiaobo_pinjie_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)
[name,path]=uigetfile({'*.jpg';'*.bmp';'gif'},'载入图像一');
if isequal(name,0)|isequal(path,0)
errordlg('没有选中文件噢','出错');
return;
else
f=imread([path,name]); %获取位置
axes(handles.axes1);%axes表示获取位置,这里选取的位置为axes1;
imshow(f); %显示图像
title('图像一');
guidata(hObject,handles) %更新结构体;
end
if(size(f,3)==3)
Y=rgb2gray(f);
% Y1=rgb2gray(g);
end
Y=double(Y);%矩阵数据类型不匹配,将数据类型进行转换后再运算。imread读入的图像是uint8数据类型
%Y1=double(Y1);
[m,n]=size(Y);
%~~~~~~~~~~~~~用Harr小波分析取概貌~~~~~~~~~~~~~~~~~~~
e=1/(2^(1/2));
Ld=e*[1,1]';
Hd=e*[-1,1]';
%~~~~~~第一幅图的小波变换
y=xbbh(Y,m,n,Ld,Ld);
Y01=xbbh(Y,m,n,Ld,Hd);
Y10=xbbh(Y,m,n,Hd,Ld);
Y11=xbbh(Y,m,n,Hd,Hd);
%~~~~~~第二幅图的小波变换
%y1=xbbh(Y1,m,n,Ld,Ld);
%y01=xbbh(Y1,m,n,Ld,Hd);
%y10=xbbh(Y1,m,n,Hd,Ld);
%y11=xbbh(Y1,m,n,Hd,Hd);
% [m,n]=size(y);
pho1=[y,Y01;Y10,Y11];
%pho2=[y1,y01;y10,y11];
axes(handles.axes2)
imshow(uint8(pho1));
title('图像一的小波分解');
save('y'); %保存变量
%figure(2)
%imshow(uint8(pho2));%imshow时要加上uint8转化成无符号8位整型才能显示
%xlabel('图像二的小波分解');
% 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)
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
[name,path]=uigetfile({'*.jpg';'*.bmp';'gif'},'载入图像二');
if isequal(name,0)|isequal(path,0)
errordlg('没有选中文件噢','出错');
return;
else
g=imread([path,name]); %获取位置
axes(handles.axes3);%axes表示获取位置,这里选取的位置为axes1;
imshow(g); %显示图像
title('图像二');
save('g'); %保存变量
guidata(hObject,handles) %更新结构体;
end
if(size(g,3)==3)
%Y=rgb2gray(f);
Y1=rgb2gray(g);
end
%Y=double(Y);%矩阵数据类型不匹配,将数据类型进行转换后再运算。imread读入的图像是uint8数据类型
Y1=double(Y1);
[m,n]=size(Y1);
%~~~~~~~~~~~~~用Harr小波分析取概貌~~~~~~~~~~~~~~~~~~~
e=1/(2^(1/2));
Ld=e*[1,1]';
Hd=e*[-1,1]';
%~~~~~~第一幅图的小波变换
%y=xbbh(Y,m,n,Ld,Ld);
%Y01=xbbh(Y,m,n,Ld,Hd);
%Y10=xbbh(Y,m,n,Hd,Ld);
%Y11=xbbh(Y,m,n,Hd,Hd);
%~~~~~~第二幅图的小波变换
y1=xbbh(Y1,m,n,Ld,Ld);
y01=xbbh(Y1,m,n,Ld,Hd);
y10=xbbh(Y1,m,n,Hd,Ld);
y11=xbbh(Y1,m,n,Hd,Hd);
% [m,n]=size(y);
%pho1=[y,Y01;Y10,Y11];
pho2=[y1,y01;y10,y11];
axes(handles.axes4)
imshow(uint8(pho2));
title('图像二的小波分解');
save('y1'); %保存变量
% 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)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
web www.wobishe.com
load('y');load('y1');
%~~~~~~~~~调用图像匹配函数寻找图像匹配点~~~~~~~~~~~
[p1,N1]=pipei(y,y1);
%~~~~~~~~~~~~~~~~拼接~~~~~~~~~~~~~~~~~~~~~
msgbox('具体联系Q609553134')
% 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)
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% 截图
SnapImage();
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)