下载
官网下载opencv3.4.1
,选择source版本
官网下载opencv3.4.1_contrib
,选择source版本
首先安装必要的依赖
1 | sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils |
编译安装opencv
1 | cp ../opencv3.4.1_contrib ./ # 复制contrib到opencv3.4.1文件夹并重命名 |
1 | CUDA_TOOLKIT_ROOT_DIR: /home/<user name>/wuxj/cuda-8.0 |
make -j8
# 等待安装成功即可 8:8核CPU,编译速度更快
make install
# 复制上一步build文件夹到/home/<user name>/wuxj
中,这时候wuxj文件夹会包含bin(exe)、include(头文件)、lib(动态库)、share4个文件夹