赞
踩
系统:Windows10
IDE:Qt 5.13
OpenCV版本:3.4.5
打开OpenCV官网:http://opencv.org,点击Release下载OpenCV
Sources
:是当前版本的OpenCV源代码;Windows
:Windows环境下编译好的文件(build)+源码;IOS pack
:IOS环境下编译好的文件(build)+源码;Android
:Android环境下编译好的文件(build)+源码;
sources放的是opencv中的cpp文件,相当于一个工厂,build放的是opencv中的h、hpp、lib文件,相当于一个工具。
source里面是各种各样的函数实现,对于只想用opencv的人来说,只关心我怎么用,于是开发者就会使用这些源文件构建出库,这些库里面包含了函数实现。这些库就是各种lib,然后还有头文件。
build里面只有接口,没有cpp中的实现什么的,build是对使用者的,使用者只用知道接口就行了,不需要知道这个是怎么做到的。当然因为opencv开源,所以使用者也可以直接查看源文件。
1、下载安装Qt和CMake
下载Qt和CMake并安装,版本无特殊要求,在此不做过多介绍;
注意:需要将如下路径加入系统环境变量,添加完后重启生效
//Qt编译器路径
D:\Qt\Qt5.13.2\5.13.2\mingw73_64\bin
D:\Qt\Qt5.13.2\Tools\mingw730_64\bin
//cmake路径
D:\SoftWare\cmake\bin
2、CMake配置并生成
路径设置完毕之后,点击Configure:
编译器填入如下路径:
C: "D:\Qt\Qt5.13.2\Tools\mingw730_64\bin\gcc.exe"
C++: "D:\Qt\Qt5.13.2\Tools\mingw730_64\bin\g++.exe"
点击Finish:
修改以下几项配置:
Name | Value |
---|---|
ENABLE | ENABLE_CXX11(选中) |
WITH | WITH_OPENGL(选中) |
WITH | WITH_QT(选中) |
WITH | WITH_IPP(不选) |
第一次点击Configure: | |
修改如下路径: |
模块 | 路径 |
---|---|
Qt5_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5 |
Qt5Concurrent_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5Concurrent |
Qt5Core_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5Core |
Qt5Gui_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5Gui |
Qt5OpenGL_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5OpenGL |
Qt5Test_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5Test |
Qt5widgets_DIR | D:/Qt/Qt5.13.2/5.13.2/mingw73_64/lib/cmake/Qt5Widgets |
第二次点击Configure:
没有红色,说明没有什么大问题了,修改版本为发行版:
第三次点击Configure:
Configuring done之后点击Generate:
生成之后的文件结构如下:
3、开始编译
在生成文件夹中按下Shift键,点击鼠标右键,选择在此处打开命令行:
输入如下指令开始编译(-j 8 多核编译):
mingw32-make -j 8
编译完成之后,输入如下指令安装:
mingw32-make install
4、问题汇总
问题一:windres.exe: preprocessing failed.
解决办法:去掉CMake中
OPENCV
项中的OPENCV_ENABLE_ALLOCATOR_STATS
的勾勾
问题二:error: ‘std::_hypot’ has not been declared
解决方法1:此问题是由于pyconfig.h和cmath 冲突所致;
修改OpenCV源码D:\Qt\openCV3.4.12\openCV3.4.12\modules\python\src2\cv2.cpp
,在 #include <pyconfig.h>之前添加#include <math.h>
解决办法2:取消CMake中的配置项:“BUILD_opencv_python3” 和 “BUILD_opencv_python_bindings_generator”
问题三:collect2.exe: error: ld returned 5 exit status
mingw32-make[2]: *** [modules\python3\CMakeFiles\opencv_python3.dir\build.make:104: lib/python3/cv2.cp37-win32.pyd] Error 1
mingw32-make[2]: *** Deleting file ‘lib/python3/cv2.cp37-win32.pyd’
mingw32-make[1]: *** [CMakeFiles\Makefile2:4181: modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
mingw32-make: *** [Makefile:162: all] Error 2
解决办法1:将CMake中的Python2、Python3中的值全部设为空
解决办法2:取消CMake中的配置项:“BUILD_opencv_python3” 和 “BUILD_opencv_python_bindings_generator”
问题四:sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA
解决办法:修改OpenCV源码:D:\Qt\openCV3.4.12\openCV3.4.12\modules\videoio\src\cap_dshow.cpp ,在#include "DShow.h"这行的上面加一行
#define NO_DSHOW_STRSAFE
问题五:
问题六:cmake中Configure时 ffmpeg.dll 下载一直失败(这会导致编译后的OpenCV无法用VideoCapture打开视频)
FFMPEG: Download: opencv_videoio_ffmpeg.dll
Try 1 failed
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
FFMPEG: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
C:/Users/Administrator/Desktop/opencv-4.5.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:22 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
FFMPEG: Download: opencv_videoio_ffmpeg_64.dll
Try 1 failed
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
FFMPEG: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
C:/Users/Administrator/Desktop/opencv-4.5.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:22 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
FFMPEG: Download: ffmpeg_version.cmake
Try 1 failed
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at cmake/OpenCVDownload.cmake:202 (message):
FFMPEG: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
C:/Users/Administrator/Desktop/opencv-4.5.0/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
3rdparty/ffmpeg/ffmpeg.cmake:20 (ocv_download)
modules/videoio/cmake/detect_ffmpeg.cmake:14 (download_win_ffmpeg)
modules/videoio/cmake/init.cmake:3 (include)
modules/videoio/cmake/init.cmake:22 (add_backend)
cmake/OpenCVModule.cmake:312 (include)
cmake/OpenCVModule.cmake:375 (_add_modules_1)
modules/CMakeLists.txt:7 (ocv_glob_modules)
解决办法:
1、打开编译生成路径(D:\Qt\opencv-3.4.5\build),找到CMakeDownloadLog.txt
,并打开如下所示:
#use_cache "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache"
#match_hash_in_cmake_cache "OCV_DOWNLOAD_ADE_HASH_3rdparty_ade_v0_1_1f_zip"
#do_copy "opencv_videoio_ffmpeg.dll" "37e2dadf776631acc8856e281f29cf42" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/opencv_videoio_ffmpeg.dll" "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg"
#missing "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg/opencv_videoio_ffmpeg.dll"
#check_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/37e2dadf776631acc8856e281f29cf42-opencv_videoio_ffmpeg.dll"
#mismatch_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/37e2dadf776631acc8856e281f29cf42-opencv_videoio_ffmpeg.dll" "d41d8cd98f00b204e9800998ecf8427e"
#delete "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/37e2dadf776631acc8856e281f29cf42-opencv_videoio_ffmpeg.dll"
#cmake_download "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/37e2dadf776631acc8856e281f29cf42-opencv_videoio_ffmpeg.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/opencv_videoio_ffmpeg.dll"
#try 1
# timeout on name lookup is not supported
# Trying 0.0.0.0...
# TCP_NODELAY set
# connect to 0.0.0.0 port 443 failed: Address not available
# Failed to connect to raw.githubusercontent.com port 443: Address not available
# Closing connection 0
#
#do_copy "opencv_videoio_ffmpeg_64.dll" "cf5dba83edf8619f57ccff4edb989c62" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/opencv_videoio_ffmpeg_64.dll" "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg"
#missing "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg/opencv_videoio_ffmpeg_64.dll"
#check_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/cf5dba83edf8619f57ccff4edb989c62-opencv_videoio_ffmpeg_64.dll"
#mismatch_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/cf5dba83edf8619f57ccff4edb989c62-opencv_videoio_ffmpeg_64.dll" "d41d8cd98f00b204e9800998ecf8427e"
#delete "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/cf5dba83edf8619f57ccff4edb989c62-opencv_videoio_ffmpeg_64.dll"
#cmake_download "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/cf5dba83edf8619f57ccff4edb989c62-opencv_videoio_ffmpeg_64.dll" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/opencv_videoio_ffmpeg_64.dll"
#try 1
# timeout on name lookup is not supported
# Trying 0.0.0.0...
# TCP_NODELAY set
# connect to 0.0.0.0 port 443 failed: Address not available
# Failed to connect to raw.githubusercontent.com port 443: Address not available
# Closing connection 0
#
#do_copy "ffmpeg_version.cmake" "f8e65dbe4a3b4eedc0d2997e07c3f3fd" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/ffmpeg_version.cmake" "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg"
#missing "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg/ffmpeg_version.cmake"
#check_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/f8e65dbe4a3b4eedc0d2997e07c3f3fd-ffmpeg_version.cmake"
#mismatch_md5 "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/f8e65dbe4a3b4eedc0d2997e07c3f3fd-ffmpeg_version.cmake" "d41d8cd98f00b204e9800998ecf8427e"
#delete "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/f8e65dbe4a3b4eedc0d2997e07c3f3fd-ffmpeg_version.cmake"
#cmake_download "C:/Users/Administrator/Desktop/opencv-4.5.0/opencv-4.5.0/.cache/ffmpeg/f8e65dbe4a3b4eedc0d2997e07c3f3fd-ffmpeg_version.cmake" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/ffmpeg_version.cmake"
#try 1
# timeout on name lookup is not supported
# Trying 0.0.0.0...
# TCP_NODELAY set
# connect to 0.0.0.0 port 443 failed: Address not available
# Failed to connect to raw.githubusercontent.com port 443: Address not available
# Closing connection 0
#
详解如下:
#do_copy "opencv_videoio_ffmpeg.dll" "37e2dadf776631acc8856e281f29cf42" "https://raw.githubusercontent.com/opencv/opencv_3rdparty/6152e132572dfdaa32887eabeb7199bef49b14dc/ffmpeg/opencv_videoio_ffmpeg.dll" "C:/Users/Administrator/Desktop/opencv-4.5.0/build/3rdparty/ffmpeg"
查看CMakeDownloadLog.txt
,可知总共有三个文件需要下载,分别是:
科学上网,访问每个文件对应的下载地址将之下载下来,其中前两个文件可以直接下载,第三个文件输入网址后不会直接下载,而是会直接将内容显示出来,之后右键网页另存为,然后修改名字为ffmpeg_version.cmake
即可(不可自己创建,然后把内容复制进去,这样哈希码对应不上,不可行)。
文件下载完之后,需要把下载下来的文件放到它应该待的地方去,总共有两处:
源代码下的opencv-4.5.0\.cache\ffmpeg
,命名格式:哈希码-文件名;
编译输出代码下的opencv-3.4.5\build\3rdparty\ffmpeg
,命名格式:与CMakeDownloadLog.txt
中的名字一致;
文件摆放好之后,再次使用cmake
:Configure-Generate,即可
编译输出目录下的install
文件夹,这个才是我们所需要的,可以将这个文件夹复制到自己想要的位置:
1、添加环境变量
D:\Qt\openCV3.4.12\openCV3.4.12-build\install\x64\mingw\bin
注意:添加完环境变量记得重启;
2、新建Qt工程并配置
INCLUDEPATH += D:\Qt\openCV3.4.12\openCV3.4.12-build\install\include\
D:\Qt\openCV3.4.12\openCV3.4.12-build\install\include\opencv2\
D:\Qt\openCV3.4.12\openCV3.4.12-build\install\include\opencv
LIBS += -L D:\Qt\openCV3.4.12\openCV3.4.12-build\install\x64\mingw\lib\libopencv_*.a
3、测试是否配置正确
#include "mainwindow.h"
#include <QApplication>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
cv::Mat image = imread("D:\\Qt\\Project\\OpenCV_Test\\1.jpg");
namedWindow("Display window",WINDOW_AUTOSIZE);
imshow("Display window",image);
waitKey(0);
MainWindow w;
w.show();
return a.exec();
}
显示图片成功!!!
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QFileDialog>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
namedWindow("Display", WINDOW_AUTOSIZE);
VideoCapture cap;
cap.open("D:/Qt/Project/OpenCV_Test/Resources/test.mp4");
if(cap.isOpened())
qDebug()<<"Sucess!";
else
qDebug()<<"False!";
Mat frame;
for(;;)
{
cap >> frame;
if(frame.empty())
break;
imshow("Display", frame);
if(waitKey(33) >= 0)
break;
}
return a.exec();
}
打开视频也成功,如此说明环境配置完完全全成功了!!!
分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线
由于opencv功能越来越臃肿,opencv3改变了项目架构,使用内核+插件的架构形式。在Github中,除了存放正式版OPENCV的主仓库和新增加的opencv_extra仓库外,还添加了一个opencv_contrib的全新仓库,功能有:脸部识别、文本识别、边缘检测、追踪算法等,里面存放的是功能未稳定的代码,如果需要使用这些功能,就需要重新进行编译,opencv的opencv_contrib的版本要一致,否则编译时会出现问题。
opencv-contrib GitHub地址:https://github.com/opencv
在cmake Configure和Generate之后,也就是到了下面这步之后,开始编译opencv-contrib
修改如下两处:
参数 | value |
---|---|
OPENCV_EXTRA_MODULES_PATH | E:\opencv-3.4.5\opencv_contrib-3.4.5\modules |
OPENCV_ENABLE_NONFREE | 勾选上 |
然后Configure直到没有红色,发现有些文件下载失败,可以参考上面,找到文件CMakeDownloadLog.txt
,将文件手动下载下来,并以指定命名格式,放在指定的路径。
xfeatures2d/boostdesc: Download: boostdesc_bgm.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_bgm_bi.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_bgm_hd.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_binboost_064.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_binboost_128.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_binboost_256.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/boostdesc: Download: boostdesc_lbgm.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/boostdesc: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_boostdesc.cmake:22 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:8 (download_boost_descriptors)
xfeatures2d/vgg: Download: vgg_generated_48.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
xfeatures2d/vgg: Download: vgg_generated_64.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
xfeatures2d/vgg: Download: vgg_generated_80.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
xfeatures2d/vgg: Download: vgg_generated_120.i
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
xfeatures2d/vgg: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/cmake/download_vgg.cmake:16 (ocv_download)
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/xfeatures2d/CMakeLists.txt:9 (download_vgg_descriptors)
data: Download: face_landmark_model.dat
=======================================================================
Couldn't connect to server from the Internet.
Perhaps direct connections are not allowed in the current network.
To use proxy please check/specify these environment variables:
- http_proxy/https_proxy
- and/or HTTP_PROXY/HTTPS_PROXY
=======================================================================
CMake Warning at E:/opencv-3.4.5/opencv-3.4.5/cmake/OpenCVDownload.cmake:193 (message):
data: Download failed: 7;"Couldn't connect to server"
For details please refer to the download log file:
E:/opencv-3.4.5/build/CMakeDownloadLog.txt
Call Stack (most recent call first):
E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/face/CMakeLists.txt:13 (ocv_download)
CMake Warning at E:/opencv-3.4.5/opencv_contrib-3.4.5/modules/face/CMakeLists.txt:26 (message):
Face: Can't get model file for face alignment.
CMake Warning at cmake/OpenCVGenSetupVars.cmake:54 (message):
CONFIGURATION IS NOT SUPPORTED: validate setupvars script in install
directory
Call Stack (most recent call first):
CMakeLists.txt:1074 (include)
第一处
第二处
文件下载完,并按指定命名格式存放在指定的位置之后,继续点击Configure,Generate
然后打开命令行开始编译:
mingw32-make -j 8
mingw32-make install
最后配置Qt工程如上(编译opencv)即可!!!
最后附上我的编译结果:
1、只编译了opencv版本
链接:https://pan.baidu.com/s/153K_qr-NWD0BqiUZft4vhQ
提取码:lpom
2、编译了opencv+opencv-contrib版本
链接:https://pan.baidu.com/s/1BGQ280dYWgu0IUj0jJvEWw
提取码:l8nm
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。