Win10 opencv cuda + 扩展库 vs2019 cuda10.1

参考:

https://blog.csdn.net/stjuliet/article/details/84640094

需要修改:

cmake:

OPENCV_GENERATE_SETUPVARS=OFF

ENABLE_PRECOMPILED_HEADERS=OFF

BUILD_opencv_cudacodec = OFF     (如修改安装文件可ON)

BUILD_opencv_world = ON        (可选, 常规下编译opencv源码会生成很多库。如果在使用CMake生成VS解决方案时把BUILD_opencv_world选项勾上,则可以只生成一个库)


修改安装文件

参考:https://www.cnblogs.com/penguins/p/10214817.html

修改cudacodevc

需要下载Video_Codec_SDK_9.1.23.zip

 


编译时vs2019切换到release编译

需要dubug的再切到debug编译一次

 


debug下:

包含目录:
D:\OpenCV348\tools\build_cuda\install\include
D:\OpenCV348\tools\build_cuda\install\include\opencv
D:\OpenCV348\tools\build_cuda\install\include\opencv2

库目录:
D:\OpenCV348\tools\build_cuda\install\x64\vc15\lib

附加依赖项:
opencv_aruco348d.lib
opencv_bgsegm348d.lib
opencv_bioinspired348d.lib
opencv_calib3d348d.lib
opencv_ccalib348d.lib
opencv_core348d.lib
opencv_cudaarithm348d.lib
opencv_cudabgsegm348d.lib
opencv_cudacodec348d.lib
opencv_cudafeatures2d348d.lib
opencv_cudafilters348d.lib
opencv_cudaimgproc348d.lib
opencv_cudalegacy348d.lib
opencv_cudaobjdetect348d.lib
opencv_cudaoptflow348d.lib
opencv_cudastereo348d.lib
opencv_cudawarping348d.lib
opencv_cudev348d.lib
opencv_datasets348d.lib
opencv_dnn348d.lib
opencv_dpm348d.lib
opencv_face348d.lib
opencv_features2d348d.lib
opencv_flann348d.lib
opencv_fuzzy348d.lib
opencv_highgui348d.lib
opencv_img_hash348d.lib
opencv_imgcodecs348d.lib
opencv_imgproc348d.lib
opencv_line_descriptor348d.lib
opencv_ml348d.lib
opencv_objdetect348d.lib
opencv_optflow348d.lib
opencv_phase_unwrapping348d.lib
opencv_photo348d.lib
opencv_plot348d.lib
opencv_reg348d.lib
opencv_rgbd348d.lib
opencv_saliency348d.lib
opencv_shape348d.lib
opencv_stereo348d.lib
opencv_stitching348d.lib
opencv_structured_light348d.lib
opencv_superres348d.lib
opencv_surface_matching348d.lib
opencv_text348d.lib
opencv_tracking348d.lib
opencv_video348d.lib
opencv_videoio348d.lib
opencv_videostab348d.lib
opencv_xfeatures2d348d.lib
opencv_ximgproc348d.lib
opencv_xobjdetect348d.lib
opencv_xphoto348d.lib


release下:

包含目录:
D:\OpenCV348\tools\build_cuda\install\include
D:\OpenCV348\tools\build_cuda\install\include\opencv
D:\OpenCV348\tools\build_cuda\install\include\opencv2

库目录:
D:\OpenCV348\tools\build_cuda\install\x64\vc15\lib

附加依赖项:
opencv_aruco348.lib
opencv_bgsegm348.lib
opencv_bioinspired348.lib
opencv_calib3d348.lib
opencv_ccalib348.lib
opencv_core348.lib
opencv_cudaarithm348.lib
opencv_cudabgsegm348.lib
opencv_cudacodec348.lib
opencv_cudafeatures2d348.lib
opencv_cudafilters348.lib
opencv_cudaimgproc348.lib
opencv_cudalegacy348.lib
opencv_cudaobjdetect348.lib
opencv_cudaoptflow348.lib
opencv_cudastereo348.lib
opencv_cudawarping348.lib
opencv_cudev348.lib
opencv_datasets348.lib
opencv_dnn348.lib
opencv_dpm348.lib
opencv_face348.lib
opencv_features2d348.lib
opencv_flann348.lib
opencv_fuzzy348.lib
opencv_highgui348.lib
opencv_img_hash348.lib
opencv_imgcodecs348.lib
opencv_imgproc348.lib
opencv_line_descriptor348.lib
opencv_ml348.lib
opencv_objdetect348.lib
opencv_optflow348.lib
opencv_phase_unwrapping348.lib
opencv_photo348.lib
opencv_plot348.lib
opencv_reg348.lib
opencv_rgbd348.lib
opencv_saliency348.lib
opencv_shape348.lib
opencv_stereo348.lib
opencv_stitching348.lib
opencv_structured_light348.lib
opencv_superres348.lib
opencv_surface_matching348.lib
opencv_text348.lib
opencv_tracking348.lib
opencv_video348.lib
opencv_videoio348.lib
opencv_videostab348.lib
opencv_xfeatures2d348.lib
opencv_ximgproc348.lib
opencv_xobjdetect348.lib
opencv_xphoto348.lib

 


最后在编译完成后,需要将上述文件对应的dll文件放到生成的目录下。

 

然后按照如下方式设置vs:

https://blog.csdn.net/PanPan_1995/article/details/86493456

你可能感兴趣的:(OpenCV,环境)