https://programmer.group/ubuntu-18.04-install-opencv3.4.5-opencv-contrib.html
uninstall https://blog.csdn.net/ytusdc/article/details/89682028
sudo apt-get update
sudo apt-get upgrade
//Dependency package
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
sudo apt-get install qt5-default ccache libv4l-dev libavresample-dev libgphoto2-dev libopenblas-base libopenblas-dev doxygen openjdk-8-jdk pylint libvtk6-dev
sudo apt-get install pkg-config
cd build
sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/tjk/opencv/opencv-3.4.5/opencv_contrib-3.4.5/modules/ -D OPENCV_ENABLE_NONFREE=True …
https://github.com/opencv/opencv/archive/refs/tags/3.4.10.zip
https://github.com/opencv/opencv_contrib/archive/refs/tags/3.4.10.zip
cd opencv-3.4.5 #Enter the opencv folder
sudo mkdir build #New folder build
cd build
sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=~/opencv-3.4.5/opencv_contrib-3.4.5/modules/ -D OPENCV_ENABLE_NONFREE=True …
sudo make -j4
sudo make install
Open file
sudo gedit /etc/ld.so.conf.d/opencv.conf
Add in blank document
/usr/local/lib
Next, configure the library
sudo ldconfig
change environment variable
sudo gedit /etc/bash.bashrc
Add at the end of the document
export PKG_CONFIG_PATH=/usr/local/opencv/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/local/opencv/lib
source .bashrc
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)