1.首先下载好需要安装的OpenCV安装包:https://github.com/opencv/opencv/releases/tag/3.4.10
2.双击进行安装
3.找到安装目录如下
4.设置环境变量
右键“我的电脑”-->属性
在Qt中使用OpenCV
INCLUDEPATH += -LD:/opencv3.10.4/opencv/build/include/opencv\
D:/opencv3.10.4/include/opencv2\
D:/opencv3.10.4/opencv/build/include\
D:/opencv3.10.4/include
CONFIG(debug, debug|release) {
LIBS += D:/opencv3.10.4\opencv\build\x64\vc15\lib/opencv_world3410d.lib
}
CONFIG(release, debug|release) {
LIBS += D:/opencv3.10.4\opencv\build\x64\vc15\lib/opencv_world3410.lib
}