1. 安装必要的依赖,依次执行:
- $ sudo apt-get update
- $ sudo apt-get install -y --no-install-recommends build-essential cmake libavcodec-dev libavformat-dev libgtk2.0-dev libgtkglext1 libgtkglext1-dev libjpeg-dev libpng-dev libswscale-dev libtbb2 libtbb-dev libtiff-dev pkg-config unzip wget
2 将终端定位到opencv-2.4.13目录,依次执行以下命令即可安装成功:
- $ mkdir build
- $ cd build
- $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUDA=ON -D ENABLE_FAST_MATH=ON -D CUDA_FAST_MATH=ON -D WITH_CUBLAS=1 -D WITH_NVCUVID=on -D CUDA_GENERATION=Auto ..
- $ make -j
- $ sudo make install