scikit-image: mean filter changes dtype
<p>I'm using the <a href="http://scikit-image.org/docs/dev/api/skimage.filters.rank.html#skimage.filters.rank.mean" rel="nofollow noreferrer">mean filter</a> from sci-kit image. However, it seems to change the <code>dtype</code> of floating-point images to <code>uint8</code>, which leads to a problem when passing that again to other filter functions.</p>

<p>As an illustration, consider the following code.</p>

<pre><code>import numpy as np
from skimage import filters
from skimage.morphology import square

def mean_filter(img):
    selem = square(3)
    print(img.dtype)
    print(img.max(), img.min())
    fi =  filters.rank.mean(img, selem=selem)
    print(fi.dtype)
    print(fi.max(), fi.min())
    return fi

arr = np.array([[.1, .2, .3], 
                [.4, .5, .6],
                [.7, .8, .9]], dtype='float64')
m = mean_filter(arr) 
</code></pre>

<p>Gives the following output.</p>

<pre><code>float64
0.9 0.1
uint8
178 76
</code></pre>

<p>However, according to the documentation the return type should be the same as the input type. What is going on here?</p>