opencv3安装(通过git)

opencv依赖项:

sudo apt-get install git cmake build-essential pkg-config libgtk2.0-dev libssl-dev libv4l-dev v4l-utils libjpeg-dev libtiff5-dev libjasper-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libxvidcore-dev libx264-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libqt4-dev libgtk-3-dev mesa-utils libgl1-mesa-dri libqt4-opengl-dev libatlas-base-dev gfortran libeigen3-dev python2.7-dev python3-dev python-numpy python3-numpy 

git下载opencv-contrib:

git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/3.0.0    # 选择版本
cd ..

git下载opencv:

git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/3.0.0

编译:

mkdir build
cd build
cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
make -j
sudo make install

echo 'export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/lib:/usr/lib:/usr/local/lib' >> ~/.bashrc
source ~/.bashrc

 

你可能感兴趣的:(opencv3安装(通过git))