faithallllll
persimmonunderhill
采纳率0%
2017-04-30 07:47

vs2015 cmake编译opencv3.1+opencv_contrib报错

5

在OPENCV_EXTRA_MODULES_PATH,添加opencv_contrib目录后报错,求问是什么问题啊?
CMake Error at /Users/Documents/opencv/source/opencv-3.2.0/cmake/OpenCVUtils.cmake:1045 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/CMakeLists.txt:5 (include)

CMake Error at /Users/Documents/opencv/source/opencv-3.2.0/cmake/OpenCVUtils.cmake:1049 (message):
Failed to download . Status=
Call Stack (most recent call first):
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
/Users/Documents/opencv/source/opencv_contrib-master/modules/dnn/CMakeLists.txt:5 (include)

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • xw13594155387 xw13594155387 9月前

    才装了opencv4.4,带contrib,已经用上了。
    1、opencv在github下的opencv_contrib-master.zip和opencv_master.zip
    2、解压到了E:\install\opencv\github
    3、修改E:\install\opencv\opencv_contrib-4.4.0\modules\xfeatures2d\cmake中的两个文件下载地址为中国镜像raw.staticdn.net,原来是raw.githubusercontent.com
    4、启动cmke,我用3.18.0
    5、源代码目录E:/install/opencv/github/opencv-master
    6、构建目录我定位f:/temp/c,随便写哪里都可以
    7、configure
    8、注意上面有个Search,可以快速帮你找到想找的项目
    9、填写项目OPENCV_EXTRA_MODULES_PATH为E:/install/opencv/github/opencv_contrib-master/modules(在Search输入extr就找到了)
    10、再次configure
    11、Generate
    12、进入构建目录命令行,执行mingw32-make -j8(4cpu就j4,单cpu就不要-j啦)
    13、看提示,如果有错就根据提示取消勾选比如python3等,应该没错误啦~~
    14、我用的是Qt5带的编译器mingw32-make,VS应该是make吧(路径设好,或者直接输入带目录的命令)
    15、执行命令mingw32-make install,然后f:\temp\c\install里面就一切都有了
    16、如果需要xfeatures2d,那么勾选BUILD_opencv_xfeatures2d即可(Search输入xf就找到了),然后重复10-15

    点赞 评论 复制链接分享
  • vonyaof fromyao 4年前
  • caozhy 从今以后生命中的每一秒都属于我爱的人 4年前

相关推荐