function [FP] = local_entropy (image, radius)

  %% Premenne   
%     radius = 5;   % nastavenie radiusu masky pre vypovet entropie bodu

   %%
%     if nargin==1
%         radius = 10;
%     else
%         radius = radius;
%     end

    img = image(:,:,1);
    mask = fspecial('disk',radius)>0;

    % vypocet lokalnej entropie
    local_ent = entropyfilt(img,mask);

    % najdenie lokalneho maxima
    [r,c,temp] = find_local_maximum(local_ent,radius);

    % najde a ponecha len body ktore su lokalne maxima
    [r,c]     = find(temp>0.95*max(temp(:)));

%     FP = [r,c,repmat(radius,[size(r,1),1])];
    
    FP = [r,c];



end

function [r,c,max_LE] = find_local_maximum (val,radius)
    mask  = fspecial('disk',radius)>0;
    nb    = sum(mask(:));
    highest = ordfilt2(val, nb, mask);
    second_highest = ordfilt2(val, nb-1, mask);
    index = highest==val & highest~=second_highest;
    max_LE = zeros(size(val));
    max_LE(index) = val(index);
    [r,c] = find(index==1);
end