赞
踩
1 首先下载opencv和opencv_contrib到自己的目录(博客使用的是3.4.4版本),下载我的资源(boostdesc_bgm_files_build_opencv_contrib_needed.zip),请先切换tag,git checkout tag 3.4.4;
2 安装opencv的依赖项(可以自己查找,网上很多教程)
3 编译opencv_cuda版本,在opencv目录下新建build并切换到目录下,开始编译opencv_cuda版本,命令如下:
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules .. \
-DWITH_CUDA=1 \
-DENABLE_FAST_MATH=1 \
-DCUDA_FAST_MATH=1 \
-DWITH_CUBLAS=1 \
-DOPENCV_GENERATE_PKGCONFIG=1 \
-DCUDA_GENERATION=Pascal ..
4 在opencv_contrib/moudles/sfm opencv/modules/java下的cmakelists中加入include_directories("/home/user/software/install_package/opencv/opencv_contrib/modules/xfeatures2d/include")路径,将opencv_contrib的cuda.hpp所在opencv2目录下文件放到opencv的moudules/stitching/include/opencv2下,继续编译.
5 将opencv_contrib下面的缺少的文件放置到opencv_contrib/modules/xfeatures2d/src/下面,可以去我的上传文件中下载.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。