官网安装教程:https://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html
1、下载:官网下载opencv-3.4.4和github下载opencv_contrib-3.4.4
2、分别解压,并将opencv_contrib-3.4.4放入opencv-3.4.4文件夹下
3、安装依赖项
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
4、mkdir build
cd build
5、CMAKE
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
没有成功,进而只进行了cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D
不知道这样有没有添加上contrib
6、make(时间比较长,可以用make -j4,4线程安装)
7、安装到计算机上
sudo make install
8、让动态链接库为系统所共享
sudo ldconfig -v
出现的问题