为了使用 OPENCV+HOG 不得不入CUDA的坑
下有另一个关键词:Opencv Hog
第一步要搞清的就是,你需要重新Configure下 OPencv
这个重新编译的含义是啥,似乎是为了生成新的dll 与lib 文件
这就意味着,你在configure完之后,又要将配置苦逼的再来一遍。
这趟浑水深不可测~~。。。
但还必须趟,。。。。因为使用的算法可以用GPU加速来提升效果。。。
先用起来再说吧。。。。
不知道又要用几天的时间。。
第一天
首先下载了cuda 7.5
然后下载了 cmake
最后听说还要 使用TBB
“To enable CUDA support, configure OpenCV using CMake with WITH_CUDA=ON . When the flag is set and if CUDA is installed, the full-featured OpenCV GPU module is built. Otherwise, the module is still built but at runtime all functions from the module throw Exception with CV_GpuNotSupported error code….”
Please re-build OpenCV, and make sure enabled CUDA support Thanks.
For more information, please refer to http://docs.opencv.org/2.4/modules/gpu/doc/introduction.html
下面是一些配置的教程链接:
http://blog.cuvilib.com/2011/03/22/how-to-build-opencv-2-2-with-gpu-cuda-on-windows-7/
https://www.researchgate.net/post/How_can_I_read_videos_using_openCV_with_CUDA_language
http://www.pyimagesearch.com/2016/07/11/compiling-opencv-with-cuda-support/
http://blog.csdn.net/kelvin_yan/article/details/38866795
http://www.cnblogs.com/freedomshe/archive/2013/01/11/win7_vs2012_opencv_rebuild.html
以防万一,先将OPENCV 整个文件夹备份再说
问题1:
Cmake is showing this error while configuring openCV with CUDA:
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:
解决方法:
Solution is to choose Visual Studio 11 Win64 instead of Visual Stuidio 11 as generator in CMAKE. this will lead to clean configuration.
问题二:
CMake Warning at cmake/OpenCVPackaging.cmake:23 (message):
CPACK_PACKAGE_VERSION does not match version provided by version.hpp
header!
Call Stack (most recent call first):
CMakeLists.txt:1105 (include)
解决方法:
似乎Generate没影响
关于TBB 与 CUDA 两者的关系的文章:
http://www.opengpu.org/forum.php?mod=viewthread&tid=4678
目前开始编译中…………
明天看看这篇文章:
https://www.researchgate.net/post/How_can_I_read_videos_using_openCV_with_CUDA_language
睡觉去……6
第二天:
遇到了编译器不兼容的问题:
Visual Studio 2012:模块计算机类型“x64”与目标计算机类型“X86”冲突
通过以下文章解决了:
http://www.huqiwen.com/2012/11/26/visual-studio-2012-fatal-error-lnk1112/