function centerOfStick = hledaniKrajeAStreduTycky(actPoint,im)
    line =[0 0];
        while ~(line(end)==0 && line(end-1)==1)
            line(end+1) = imBW(actPoint(1),actPoint(2));
            actPoint(2) = actPoint(2)+1;
            im(actPoint(1), actPoint(2),:) = [255 0 0]; 
        end
        rightEdge = actPoint(2);
        P = find(line==1);
        P = P(end);
        L = find(line==1);
        L = L(1);
        radii = round((P-L)/2);
        center = [actPoint(1), actPoint(2)-radii-1]; %střed kolíku
        actPoint = [center(1), center(2)];
        centerOfStick = actPoint;
end