function newTops = odstraneniVrcholu(Tops, im, MaxNumOfStcks)
    imshow(im);
    hold on;
    for i = 1:MaxNumOfStcks
        plot(Tops(i,2),Tops(i,1), 'r+', 'MarkerSize', 20, 'LineWidth', 2);
    end
    
    text(2,10,'Chcete odstranit vrchol? ANO - enter, NE - space','Color','red','FontSize',14);
    ch = getkey;
    switch ch
        case 13  
            while ch == 13
                while 1
                    [xi, yi, but] = ginput(1);      % get a point
                    if isequal(but, 1)             % stop if not button 1
                        break
                    end
                end
            xv = [xi-10, xi+10, xi+10, xi-10, xi-10];
            yv = [yi+10, yi+10, yi-10, yi-10, yi+10];
            xq = Tops(1,:);
            yq = Tops(2,:);
            in = inpolygon(xq,yq,xv,yv);
            imshow(im);
            plot(xv,yv,'LineWidth',2) % polygon
            axis equal
            hold on
            plot(xq(in),yq(in),'r+') % points inside
            plot(xq(~in),yq(~in),'bo') % points outside
            hold off
            end
        case 32 
    end
end