function endp = mouse2points(m,n);
%
% function endp = mouse2points(img);
%
% 
%
% (c) Moo K. Chung 
%     mkchung@wisc.edu
%     Univeristy of Wisconsin
%
% October 3, 2010



%img=ones(m,n);
figure; 
%imshow(img);

imshow('toy-key.tif')
set(gcf,'Color','white','InvertHardcopy','off');
axis on
hold on
xy = [];
n = 0;
but = 1;
while but == 1
    [xi,yi,but] = ginput(1);
    plot(xi,yi,'ro')
    n = n+1;
    xy(:,n) = [xi;yi];
end
%hold on; plot([xy(1,:) xy(1,1)], [xy(2,:) xy(2,1)], 'r-');

endp=xy';
