function res = erosion( I, rayon)
    [m, n] = size(I);      %m=nb lignes, n=nb colonnes, can=nb canaux
    res=zeros(m, n);
    for i=rayon+1:m-1-rayon
        for j=rayon+1:n-1-rayon
            if(I(i, j)>0)
                res(i, j)=min(min(I(i-rayon:i+rayon, j-rayon:j+rayon)));
            end
        end
    end;
end