1.本地环境
cuda=9.0
python=3.6
cmake=5.6
2.安装的opencv版本=2.4.13
3.安装流程
(1)从github上下载opencv2.4.13的源码
(2)安装
unzip opencv-2.4.13.zip cd opencv-2.4.13 mkdir build cd build cmake .. make
4.出现的问题
(1)
CUDA_nppi_LIBRARY (ADVANCED) linked by target "opencv_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev
出现类似的这样的问题。解决方案如下:
https://blog.youkuaiyun.com/u014613745/article/details/78310916
简单记录下:
opencv2 只需执行1,2,3,5步骤,opencv3执行1,2,3,4,5步骤
1).找到FindCUDA.cmake文件
找到行
find_cuda_helper_libs(nppi)
改为
find_cuda_helper_libs(nppial)
find_cuda_helper_libs(nppicc)
find_cuda_helper_libs(nppicom)
find_cuda_helper_libs(nppidei)
find_cuda_helper_libs(nppif)
find_cuda_helper_libs(nppig)
find_cuda_helper_libs(nppim)
find_cuda_helper_libs(nppist)
find_cuda_helper_libs(nppisu)
find_cuda_helper_libs(nppitc)
2).找到行
set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}")
改为
set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRAR