打开终端,输入以下命令
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
使用D435 Realsense深度相机需要用到opencv3.4.0的dnn模块
在终端输入
git clone https://github.com/opencv/opencv.git
git checkout 3.4
创建build,进入build目录下运行
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -DBUILD_CV_EXAMPLES=true -D CMAKE_INSTALL_PREFIX=/usr/local …
添加OpenCVConfig.cmake所在目录到~/.bashrc
gedit ~/.bashrc
文末添加:export OpenCV_DIR=/home/cjx/opencv/build
source使之生效
source ~/.bashrc