我在JupyterWeb上工作,下面是我的代码。你知道吗
def get_hist(img, bins):
histogram = np.zeros(bins)
for pixel in im:
histogram[pixel] += 1
return get_hist
hist = get_hist(flat, 256)
plt.plot(hist)
我一直都有这个问题。你知道吗
TypeError: float() argument must be a string or a number, not 'function'
有什么有用的建议吗?你知道吗
您编写了一个返回自己的函数对象的函数。这不会提供太多的功能或可用性。您可能需要返回
histogram
,这似乎是您的函数想要做的。你知道吗相关问题 更多 >
编程相关推荐