mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-17 11:32:45 +08:00
Fix invalid previous fix for percentile edge case
This commit is contained in:
@@ -161,14 +161,14 @@ cdef inline double _kernel_percentile(Py_ssize_t* histo, double pop, dtype_t g,
|
||||
cdef Py_ssize_t sum = 0
|
||||
|
||||
if pop:
|
||||
if p0 == 0: # make sure p0 == 0 returns the minimum filter
|
||||
for i in range(max_bin):
|
||||
if p0 == 1: # make sure p0 = 1 returns the maximum filter
|
||||
for i in range(max_bin - 1, -1, -1):
|
||||
if histo[i]:
|
||||
break
|
||||
else:
|
||||
for i in range(max_bin):
|
||||
sum += histo[i]
|
||||
if sum >= p0 * pop:
|
||||
if sum > p0 * pop:
|
||||
break
|
||||
return i
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user