opencv源码编译之下载超时问题

opencv源码编译之下载超时问题

  • 错误:安装opencv时,xfeatures2d模块缺失boostdesc_bgm.i文件,下载超时问题。

  • 原因:无法访问国外的网站导致下载超时而失败。

  • 分析:打开文件build/CMakeDownloadLog.txt,如下所示:

    指定缓存文件夹
    #use_cache "/home/user/Project/OpenCV/opencv/.cache"
    解压路径
    #do_unpack "ippicv_2019_lnx_intel64_general_20180723.tgz" "c0bd78adb4156bbf552c1dfe90599607" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz" "/home/user/Project/OpenCV/build/3rdparty/ippicv"
    文件校验
    #check_md5 "/home/user/Project/OpenCV/opencv/.cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz"
    文件校验失败
    #mismatch_md5 "/home/user/Project/OpenCV/opencv/.cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" "d41d8cd98f00b204e9800998ecf8427e"
    删除下载文件
    #delete "/home/user/Project/OpenCV/opencv/.cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz"
    下载文件
    #cmake_download "/home/user/Project/OpenCV/opencv/.cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz"
    #   Trying 0.0.0.0...
    # TCP_NODELAY set
    # connect to 0.0.0.0 port 443 failed: Connection refused
    #   Trying ::...
    # TCP_NODELAY set
    # connect to :: port 443 failed: Connection refused
    # Failed to connect to raw.githubusercontent.com port 443: Connection refused
    # Closing connection 0
    # 
    
  • 办法:只需要下载文件那一行中找到下载地址和存放地址即可,例如:

    #cmake_download 下载后保存地址 下载地址
    
    #cmake_download "/home/user/Project/OpenCV/opencv/.cache/ippicv/c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz"
    
    下载地址:https://raw.githubusercontent.com/opencv/opencv_3rdparty/32e315a5b106a7b89dbed51c28f8120a48b368b4/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz
    保存地址:
    /home/user/Project/OpenCV/opencv/.cache/ippicv/
    保存文件名
    c0bd78adb4156bbf552c1dfe90599607-ippicv_2019_lnx_intel64_general_20180723.tgz
    注:保存文件名格式:md5-文件名.扩展名
    

    最后将build/CMakeDownloadLog.txt的所有所需文件通过梯子下载后保存到指定位置即可。最后再次执行:

    cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
    

你可能感兴趣的:(OpenCV,图像处理,opencv,计算机视觉,人工智能)