fix 16bit percentile

This commit is contained in:
Olivier Debeir
2012-10-10 15:48:36 +02:00
parent 633f30e23f
commit 175658e677
+2 -2
View File
@@ -118,13 +118,13 @@ cdef inline np.uint16_t kernel_morph_contr_enh(int* histo, float pop, np.uint16_
p1 = 1.0-p1
for i in range(maxbin):
sum += histo[i]
if sum>=p0*pop:
if sum>p0*pop:
imin = i
break
sum = 0
for i in range((maxbin-1),-1,-1):
sum += histo[i]
if sum>=p1*pop:
if sum>p1*pop:
imax = i
break
if g>imax: