1、安装依赖库
sudo apt-get install g++
sudo apt-get install cmake
sudo apt-get install unzip
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 vim
2、下载并解压opencv4.5.1安装包
下载网址:Releases - OpenCV,选择Sources
解压安装包
unzip opencv-4.5.1
3、修复bug
opencv-4.5.1有一个小bug,用vim打开