问题一:由于Cuda9.0以上不支持opencv2.0架构,安装时会报错
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
需要修改几个文件
1) FindCUDA.cmake (opencv-2.4.13/cmake/FindCUDA.cmake)
2) OpenCVDetectCUDA.cmake
cuda_fp16.h (opencv\modules\cudev\include\opencv2\cudev\common.hpp)
参考:https://blog.csdn.net/u014613745/article/details/78310916
问题二: Linux环境下装OpenCV3 缺少ippicv问题
由于直接在cmake时下载很有可能会提示下载失败,因此可以单独下载后,对文件名进行hash放进对应的路径中
$ ipp_file=ippicv_2017u2_lnx_intel64_20170418.tgz&&
> ipp_hash=$(md5sum ../$ipp_file | cut -d" "-f1) &&
> ipp_dir=.cache/ippicv &&
> mkdir -p ${ipp_dir} &&
> sudo cp ../$ipp_file $ipp_dir/$ipp_hash-$ipp_file
参考:https://www.cnblogs.com/lynsyklate/p/7719500.html
问题三:Unsupported gpu architecture'compute_11'解决方法
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..
参考:https://blog.csdn.net/sysuwuhongpeng/article/details/45485719
问题四:error: #error "libswscale is necessaryto build the newer OpenCV ffmpeg wrapper"
修改文件/home/liuyujun/opencv-2.4.13/modules/highgui/src/cap_ffmpeg_impl.hpp
直接添加以下头文件,删除带有上述error的语句
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>