OpenCV3.2-Linux安装

主要参考博客:Ubuntu16.04下安装OpenCV3.2.0
主要问题
libjasper-dev 找不到:https://blog.csdn.net/weixin_41053564/article/details/81254410
cmake报错参考博客:https://blog.csdn.net/u014613745/article/details/78310916
make时ffmpeg模块报错:https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg


如果要用cuda则使用下面的cmake参数:
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler -D WITH_LAPACK=OFF -D WITH_BLAS=OFF ..
如果用扩展模块 :
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler -D WITH_LAPACK=OFF -D WITH_BLAS=OFF -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -D WITH_LIBV4L=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..

参数说明:

参数 意义
WITH_LIBV4L 是与usb摄像头有关的参数
WITH_CUDA 看看你有没有装cuda

如果有make时有报以下错误:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppi_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev
linked by target "opencv_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev/test
....... 

那么可以参考 https://blog.csdn.net/u014613745/article/details/78310916

原文地址:https://www.cnblogs.com/kidtic/p/14613966.html