1. 下载
下载opencv4.10
2. 编译opencv
2.1 安装依赖库
sudo apt install -y g ++
sudo apt install -y cmake
sudo apt install -y make
sudo apt install -y wget
sudo apt install -y unzip
sudo apt-get install build-essential libgtk2.0-dev libgtk-3-devlibavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
sudo apt-get install pkg-config #这个依赖也要装,要不最后会出现报错,验证的时候。
2.2 编译安装
unzip opencv4.10
mkdir build
cd build
sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/user/local ..
sudo mkae -j4
sudo make install
编译结束