实现人脸信息采集需要下载XML训练文件:https://download.csdn.net/download/m0_66984268/80272590
源代码:
.pro文件
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# 下面是根据自身opencv安装位置进行调整
INCLUDEPATH += F:/Opencv/build/install/include/opencv \
F:/Opencv/build/install/include/opencv2 \
F:\Opencv\source\opencv-3.4.0\modules\core\include\opencv2\core \
F:/Opencv/build/install/include
LIBS += -L F:/Opencv/build/install/x64/mingw/lib/libopencv_*.a
# 以上结合自身情况
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.