OpenCV. 环境搭建

1.源码下载地址:https://opencv.org/releases.html


2.安装编译工具:sudo apt-get install build-essential


3.安装 cmake、git、pkg-config等辅助工具:

sudo apt-get install cmake git pkg-config libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev


4.安装关联库:

sudo apt-get install python-dev python-opencv python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev


5.解压,配置

unzip opencv_3.0.0.zip

cd opencv-3.0.0

mkdir release

cd release

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..


6.编译,安装

make -j $(nproc)

sudo make install


7.环境配置

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'

sudo ldconfig







你可能感兴趣的:(OpenCV)