ubuntu安装opencv

  1. opencv下载
    https://github.com/opencv/opencv/archive/3.0.0.zip
  2. 安装opencv所需依赖
sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev libhdf5-dev -y
  1. 编译opencv
cd opencv3.0.0
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON ..
make
make all
  1. 做软连接
ln -s ./lib/cv2.so /usr/local/lib/python2.7/dist-packages/cv2.so
  1. 验证


    image.png

你可能感兴趣的:(ubuntu安装opencv)