首先,安装依赖
1 sudo apt-get install build-essential
2 sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
3 sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev 然后,编译安装 opencv
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON 
-D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D BUILD_TIFF=ON ..
make -j8
sudo make install 最后检查是否存在cv2.so文件
/usr/local/lib/python2.7/dist-packages/cv2.so
05-28 00:17