所以我试着在图像上的几个功能中使用scikit图像。其中一个功能是将图像从rgb转换为hsv,在那里我拍摄了我的图像(img),并说
from skimage.color import rgb2hsv
img_hsv = color.rgb2hsv(img)Python在导入skimage语句时似乎没有问题,但是当我调用color.rgb2hsv时,我得到了一个'color' is not defined错误。如果我说的是img_hsv = rgb2hsv,那么它就是'rgb2hsv' is not defined。我试图通过从github克隆它并按照下面的说明安装scikit映像。http://scikit-image.org/docs/dev/install.html出于某种原因,每当我不得不说pip install -e .时,它都写着python 2.7 discovered. You must install scikit-image lower than 0.15.,但我确实有Python3.6,所以我应该可以安装它3.6,但出于某种原因,不管我做什么,Linux都不允许我安装它。那么我能做些什么来解决这个问题呢?
发布于 2019-01-21 09:54:07
pip默认安装Python包的最新稳定版本。用pip install scikit-image安装最新的稳定版本而不是从GitHub克隆它有什么问题?最新稳定版本的科学图像(图像处理例程的SciPy)是0.14.2.
打开终端并键入:
sudo apt install python3-pip
sudo pip3 install scikit-image 如果还没有安装numpy、scipy、pillow和matplotlib,那么上面的命令也会将这些包作为依赖项来安装。
顺便说一下,您有一个错误,上面写着NameError: name 'color' is not defined,因为您忘记了从skimage导入颜色。
https://askubuntu.com/questions/1111594
复制相似问题