【发布时间】:2016-03-10 15:59:31
【问题描述】:
from numpy import *
from pylab import *
from scipy import *
from scipy.signal import *
from scipy.stats import *
testimg = imread('path')
hist = hist(testimg.flatten(), 256, range=[0.0,1.0])[0]
hist = hist + 0.000001
prob = hist/sum(hist)
entropia = -1.0*sum(prob*log(prob))#here is error
print 'Entropia: ', entropia
我有这个代码,但我不知道可能是什么问题,感谢您的帮助
【问题讨论】:
-
它在这里运行。错误是什么?可以添加错误输出吗?
标签: python python-2.7 numpy scipy