function varargout = Compare(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Compare_OpeningFcn, ...
'gui_OutputFcn', @Compare_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
function Compare_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = Compare_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function pushbutton1_Callback(hObject, eventdata, handles)
function pushbutton2_Callback(hObject, eventdata, handles)
function pushbutton1_KeyPressFcn(hObject, eventdata, handles)
function pushbutton1_ButtonDownFcn(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.png','Select an image');
global I1;
I1 =imread(strcat(PathName,FileName));
axes(handles.axes1);
imshow(I1);
function pushbutton3_Callback(hObject, eventdata, handles)
function pushbutton4_Callback(hObject, eventdata, handles)
function pushbutton5_Callback(hObject, eventdata, handles)
function pushbutton6_Callback(hObject, eventdata, handles)
function pushbutton5_ButtonDownFcn(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.png','Select an image');
global I2;
I2 =imread(strcat(PathName,FileName));
axes(handles.axes3);
imshow(I2);
function pushbutton6_ButtonDownFcn(hObject, eventdata, handles)
global I1;
global I2;
global I3;
global I4;
global I5;
Imaged1 = im2double(I1);
Imaged2 = im2double(I2);
Imaged3 = im2double(I3);
Imaged4 = im2double(I4);
Imaged5 = im2double(I5);
Imageg1 = rgb2gray(Imaged1);
Imageg2 = rgb2gray(Imaged2);
Imageg3 = rgb2gray(Imaged3);
Imageg4 = rgb2gray(Imaged4);
Imageg5 = rgb2gray(Imaged5);
hn1 = imhist(Imageg1)./numel(Imageg1);
hn2 = imhist(Imageg2)./numel(Imageg2);
hn3 = imhist(Imageg3)./numel(Imageg3);
hn4 = imhist(Imageg4)./numel(Imageg4);
hn5 = imhist(Imageg5)./numel(Imageg5);
f1 = sum((hn1 - hn2).^2);
f2 = sum((hn1 - hn3).^2);
f3 = sum((hn1 - hn4).^2);
f4 = sum((hn1 - hn5).^2);
set(handles.text2,'String',f1)
set(handles.text3,'String',f2)
set(handles.text4,'String',f3)
set(handles.text5,'String',f4)
function pushbutton3_ButtonDownFcn(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.png','Select an image');
global I3;
I3 =imread(strcat(PathName,FileName));
axes(handles.axes4);
imshow(I3);
function pushbutton4_ButtonDownFcn(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.png','Select an image');
global I4;
I4 =imread(strcat(PathName,FileName));
axes(handles.axes5);
imshow(I4);
function pushbutton2_ButtonDownFcn(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.png','Select an image');
global I5;
I5 =imread(strcat(PathName,FileName));
axes(handles.axes6);
imshow(I5);