function load_pushbutton_Callback(hObject, eventdata)


global h var
var = [];
var.Hpoints = 48;
var.Vpoints = 32;

if isfield(h,'BRpoint') && ishandle(h.BRpoint)
    var.BR = [];
    delete(h.BRpoint);
end
if isfield(h,'BLpoint') && ishandle(h.BLpoint)
    var.BL = [];
    delete(h.BLpoint);
end
if isfield(h,'TLpoint') && ishandle(h.TLpoint)
    var.TL = [];
    delete(h.TLpoint);
end

set(h.buttons.gridbutton,'visible','off')
set(h.buttons.accept_grid,'visible','off')
set(h.buttons.reject_grid,'visible','off')
set(h.text.Grid,'visible','off')


[FileName,PathName,FilterIndex] = uigetfile('*.jpg')

rgbimage = imread([PathName FileName]);

gray = double(rgb2gray(rgbimage))/256;
gray = gray(end:-1:1,:);
Imsize = size(gray);

var.gray = interp2(gray,[1:0.5:Imsize(2)],[1:.5:Imsize(1)]','linear'); 
var.Imsize = size(var.gray);

h.image = subplot(1,1,1);
h.plot = pcolor(var.gray);
set(h.plot,'edgecolor','none')
colormap gray

set(h.buttons.load,'backgroundcolor','w')
set(h.frame.Corners,'backgroundcolor','r','visible','on')
set(h.buttons.BLbutton,'visible','on','backgroundcolor','r')
set(h.buttons.TLbutton,'visible','on','backgroundcolor','r')
set(h.buttons.BRbutton,'visible','on','backgroundcolor','r')
set(h.text.Corners,'visible','off')
set(h.text.info,'string','Select Corners')
set(h.text.results,'visible','off')

end

