diff --git a/skimage/filters/rank/bilateral_cy.pyx b/skimage/filters/rank/bilateral_cy.pyx index 3acc26a4..a008e682 100644 --- a/skimage/filters/rank/bilateral_cy.pyx +++ b/skimage/filters/rank/bilateral_cy.pyx @@ -26,7 +26,7 @@ cdef inline void _kernel_mean(dtype_t_out* out, Py_ssize_t odepth, bilat_pop += histo[i] mean += histo[i] * i if bilat_pop: - out[0] = mean / bilat_pop + out[0] = (mean / bilat_pop) else: out[0] = 0 else: diff --git a/skimage/filters/rank/generic_cy.pyx b/skimage/filters/rank/generic_cy.pyx index a5c70bf4..3b28005a 100644 --- a/skimage/filters/rank/generic_cy.pyx +++ b/skimage/filters/rank/generic_cy.pyx @@ -29,7 +29,7 @@ cdef inline void _kernel_autolevel(dtype_t_out* out, Py_ssize_t odepth, break delta = imax - imin if delta > 0: - out[0] = (max_bin - 1) * (g - imin) / delta + out[0] = ((max_bin - 1) * (g - imin) / delta) else: out[0] = 0 else: @@ -49,7 +49,7 @@ cdef inline void _kernel_bottomhat(dtype_t_out* out, Py_ssize_t odepth, for i in range(max_bin): if histo[i]: break - out[0] = g - i + out[0] = (g - i) else: out[0] = 0 diff --git a/skimage/filters/rank/percentile_cy.pyx b/skimage/filters/rank/percentile_cy.pyx index 3be4b52a..4d90555f 100644 --- a/skimage/filters/rank/percentile_cy.pyx +++ b/skimage/filters/rank/percentile_cy.pyx @@ -116,7 +116,7 @@ cdef inline void _kernel_sum(dtype_t_out* out, Py_ssize_t odepth, sum_g += histo[i] * i if n > 0: - out[0] = (sum_g) + out[0] = sum_g else: out[0] = 0 else: