[scikit-image] Observed difference between skimage.filters.rank.mean and scipy.signal.convolve2d

Poughon Victor Victor.Poughon at cnes.fr
Thu Nov 2 04:53:07 EDT 2017


Hello,

I looks like skimage.filters.rank.mean and scipy.signal.convolve2d don't output exactly the same images. When doing:

    image = data.coins()
    K = np.ones((11, 11))

    rank_mean = rank.mean(image, selem=K)
    naive_convolve = convolve2d(image, K, mode="same") / K.sum()

All output pixel are different, with an absolute difference varying randomly between 0 and 1. Of course there's also a massive difference at the border, but that's expected because convolve2d treats image boundaries differently. But even in the center of the image all pixels are different. I've made a test script with an illustrated output image, you can check it out in this gist:

https://gist.github.com/vpoughon/b4afc76ce5dc681fda9d0550d41359d3

Am I doing something wrong?

Thanks,

Victor Poughon






More information about the scikit-image mailing list