1.文件准备
wget https://github.com/opencv/opencv/archive/3.4.0.zip
wget https://github.com/opencv/opencv_contrib/archive/3.4.0.zip
2.安装依赖包
一个个装:
2.1
sudo apt-get install build-essential
2.2
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
2.3
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
对于2.3出现的错误:E: Unable to locate package libjasper-dev的解决办法::
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev
2.4
sudo apt-get install build-essential qt5-default ccache libv4l-dev libavresample-dev libgphoto2-dev lib