function im = CropImGUI(im, centers)
 [r, c] = size(im);
    halfHigh = round(r/2);
    halfWidth = round(c/6);
    LH = [];
    LD = [];
    PD = [];
    PH = [];
     for i = 1:length(centers)              %rozdělení bodů na levyý horní, pravý dolní, atd.
        if (centers(i,2) < halfHigh && centers(i,1)< halfWidth)
            LH(end+1,:) = centers(i,:);
        end
        if (centers(i,2) > halfHigh && centers(i,1)< halfWidth)
            LD(end+1,:) = centers(i,:);
        end
         if (centers(i,2) > halfHigh && centers(i,1)> halfWidth)
            PD(end+1,:) = centers(i,:);
         end
         if (centers(i,2) < halfHigh && centers(i,1)> halfWidth)
            PH(end+1,:) = centers(i,:);
         end
     end
     
      Width = round(sqrt((PH(1)-LH(1))^2 + (PH(2)-LH(2))^2));    %šířka, vzdálenost bodů
      Heigh = round(sqrt((LD(1)-LH(1))^2 + (LD(2)-LH(2))^2));    %výška
      im = imcrop(im,[LH(1),LH(2)-150,Width+50,Heigh+50]);
end