ubuntu编译安装opencv3.4 opencv3.4_contrib

1. 安装相应的依赖 :

sudo apt-get install cmake    sudo apt-get install gcc g++

to support python2: sudo apt-get install python-dev python-numpy  最开始以为conda虚拟环境存在numpy库所以没装,所以一直无法生成共享库, python-numpy通过apt-get install

to support python3:  sudo apt-get install python3-dev python3-numpy

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev

gtk2: sudo apt-get install libgtk2.0-dev

gtk3: sudo apt-get install libgtk-3-dev

sudo apt-get install libpng-dev

sudo apt-get install libjpeg-dev

sudo apt-get install libopenexr-dev

sudo apt-get install libtiff-dev

sudo apt-get install libwebp-dev

启用python3 禁用python2: 

reference:

  • CMAKE_BUILD_TYPE=Release:不启用调试信息,并进行速度优化。
  • CMAKE_VERBOSE_MAKEFILE=ON:务必开启,以便于发现编译中出现的问题。

你可能感兴趣的:(深度学习入门,ubuntu,linux)