diff --git a/skimage/filter/rank/bilateral_rank.pyx b/skimage/filter/rank/bilateral_rank.pyx index 04f6cb35..e2a1fcf3 100644 --- a/skimage/filter/rank/bilateral_rank.pyx +++ b/skimage/filter/rank/bilateral_rank.pyx @@ -36,7 +36,7 @@ __all__ = ['bilateral_mean', 'bilateral_pop'] def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y, s0, s1): - selem = img_as_ubyte(selem) + selem = img_as_ubyte(selem > 0) image = np.ascontiguousarray(image) if mask is None: diff --git a/skimage/filter/rank/percentile_rank.pyx b/skimage/filter/rank/percentile_rank.pyx index 7deae623..9db81bcc 100644 --- a/skimage/filter/rank/percentile_rank.pyx +++ b/skimage/filter/rank/percentile_rank.pyx @@ -35,7 +35,7 @@ __all__ = ['percentile_autolevel', 'percentile_gradient', def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y, p0, p1): - selem = img_as_ubyte(selem) + selem = img_as_ubyte(selem > 0) image = np.ascontiguousarray(image) if mask is None: diff --git a/skimage/filter/rank/rank.pyx b/skimage/filter/rank/rank.pyx index 5380363a..2ef5484e 100644 --- a/skimage/filter/rank/rank.pyx +++ b/skimage/filter/rank/rank.pyx @@ -28,7 +28,7 @@ __all__ = ['autolevel', 'bottomhat', 'equalize', 'gradient', 'maximum', 'mean', def _apply(func8, func16, image, selem, out, mask, shift_x, shift_y): - selem = img_as_ubyte(selem) + selem = img_as_ubyte(selem > 0) image = np.ascontiguousarray(image) if mask is None: