Fix rank filter kernels

This commit is contained in:
Johannes Schönberger
2014-12-05 21:56:01 -05:00
parent f82243904f
commit 37560287a9
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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] = <dtype_t_out>mean / bilat_pop
out[0] = <dtype_t_out>(mean / bilat_pop)
else:
out[0] = <dtype_t_out>0
else:
+2 -2
View File
@@ -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] = <dtype_t_out>(max_bin - 1) * (g - imin) / delta
out[0] = <dtype_t_out>((max_bin - 1) * (g - imin) / delta)
else:
out[0] = <dtype_t_out>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] = <dtype_t_out>g - i
out[0] = <dtype_t_out>(g - i)
else:
out[0] = <dtype_t_out>0
+1 -1
View File
@@ -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] = <dtype_t_out>(sum_g)
out[0] = <dtype_t_out>sum_g
else:
out[0] = <dtype_t_out>0
else: