1 安装numpy,scipy, matplotlib, 

sudo apt-get install python-numpy
sudo apt-get install python-scipy
sudo apt-get install python-matplotlib
sudo apt-get install python-dev

 

2 图片处理相关的科学库

pip install scikit-image

 

3 安装cv2

需要下载opencv,我用的是opencv-2.4.13.zip

1》安装依赖

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

 

2》解压文件,并进入加压后的文件夹中

unzip opencv-2.4.13.zip
cd opencv-2.4.13

 

3》使用CMake编译opencv源码,并安装

mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install

此时,如果在pycharm中还不可以使用,解决办法请看之前文章