function varargout = ImageSearch(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ImageSearch_OpeningFcn, ...
                   'gui_OutputFcn',  @ImageSearch_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 ImageSearch_OpeningFcn(hObject, eventdata, handles, varargin)

guidata(hObject, handles);

function varargout = ImageSearch_OutputFcn(hObject, eventdata, handles) 
varargout{1} = handles.output;


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile({'*.jpg';'*.bmp';'*.gif';'*.*'}, 'Pick an Image File');
orginal = imread([pathname,filename]);
%orginal = rgb2gray(orginal);
axes(handles.axes1);
imshow(orginal);

handles.orginal = orginal; %read image types of JPG, BMP, GIF and assign to handles.original
guidata(hObject, handles); 

function pushbutton2_Callback(hObject, eventdata, handles)
image= handles.orginal;
%P=imread(image);
searchImageHist(image,'model.mat',5)
