我是一个新的科学学习包,我正在学习一些教程,然后来到这个例子:color.html#example-plot-rag-mean-color-py。
from skimage import graph, data, io, segmentation, color
from matplotlib import pyplot as plt
img = data.coffee()
labels1 = segmentation.slic(img, compactness=30, n_segments=400)
out1 = color.label2rgb(labels1, img, kind='avg')
g = graph.rag_mean_color(img, labels1)
labels2 = graph.cut_threshold(labels1, g, 29)
out2 = color.label2rgb(labels2, img, kind='avg')
plt.figure()
io.imshow(out1)
plt.figure()
io.imshow(out2)
io.show()我知道这个错误:
Traceback (most recent call last):
File "ColorThresh.py", line 8, in <module>
out1 = color.label2rgb(labels1, img, kind='avg')
TypeError: label2rgb() got an unexpected keyword argument 'kind'关于职能的文件:
http://scikit-image.org/docs/dev/api/skimage.color.html?highlight=label2rgb#skimage.color.label2rgb
我用的是ubuntu 14.04
scikit图像(0.10.1)
python (2.7.6)
有什么建议吗?
发布于 2015-01-29 15:54:37
我已经试过你的密码了。也在Ubuntu 14.04上。它的工作很好,,我刚刚安装了scipy:http://www.scipy.org/
或者您可以使用pip安装手册,所有这些列表:
# pip install numpy --upgrade
# pip install scipy --upgrade
# pip install matplotlib --upgrade
# pip install ipython --upgrade
# pip install pandas --upgrade
# pip install sympy --upgrade
# pip install nose --upgradehttps://stackoverflow.com/questions/27952185
复制相似问题