mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-17 11:32:45 +08:00
Merge remote-tracking branch 'cgohlke/patch-2' into msvc_build_fix
Conflicts: skimage/filter/rank/_crank16.pyx skimage/filter/rank/_crank8.pyx
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#cython: wraparound=False
|
||||
|
||||
cimport numpy as cnp
|
||||
from libc.math cimport log2
|
||||
from libc.math cimport log
|
||||
from skimage.filter.rank._core16 cimport _core16
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ cdef inline dtype_t kernel_entropy(Py_ssize_t * histo, float pop,
|
||||
for i in range(maxbin):
|
||||
p = histo[i] / pop
|
||||
if p > 0:
|
||||
e -= p * log(p) / 0.30102999566398119521373889472449
|
||||
e -= p * log(p) / 0.6931471805599453
|
||||
|
||||
return <dtype_t>e * 1000
|
||||
else:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#cython: wraparound=False
|
||||
|
||||
cimport numpy as cnp
|
||||
from libc.math cimport log2
|
||||
from libc.math cimport log
|
||||
from skimage.filter.rank._core8 cimport _core8
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ cdef inline dtype_t kernel_entropy(Py_ssize_t * histo, float pop,
|
||||
for i in range(256):
|
||||
p = histo[i] / pop
|
||||
if p > 0:
|
||||
e -= p * log(p) / 0.30102999566398119521373889472449
|
||||
e -= p * log(p) / 0.6931471805599453
|
||||
|
||||
return <dtype_t>e * 10
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user