function [thePoint] = clickOnOrangePoint2(im,Origin)
    im2 = imcrop(im, Origin);
    imshow(im2)
  warningText = insertText(im2, [30 40], 'Klikněte na oranžový bod rámu.','FontSize',60);
   imshow(warningText);
                while 1
                    [xi, yi, but] = ginput(1);      % get a point
                    if isequal(but, 1)             % stop if not button 1
                        break
                    end
                end
                close all;
                newOrigin = [xi-30, yi-30];
                im3 = imcrop(im2, [newOrigin(1), newOrigin(2), 50, 50]);
               % Centers = [];
                im2Gray = rgb2gray(im3);
                Centers = [];
%                 for i = 1:10
%                     im2BW = imbinarize(im2Gray, 0.1*i);
%                     [Centers] = imfindcircles(im2BW,[8 25],"ObjectPolarity", "dark");     %najdu středy a průměry kružnic v daném rozsahu
%                     if ~isempty(Centers)
%                         break;
%                     end
% 
%                 end
                if isempty(Centers)
                    Centers = [xi, yi];
                     centersStrong = Centers;  
                else 
                     centersStrong = Centers(1,:);                       
                     
                    centersStrong = [centersStrong(1) + newOrigin(1), centersStrong(2) + newOrigin(2)];
                end
                centersStrong = [centersStrong(1) + Origin(1), centersStrong(2) + Origin(2)];
                thePoint = [centersStrong(1), centersStrong(2)];

end