Qt Creator配置dlib和opencv

在ubuntu下安装好Qt Creator后,使用dlib库进行人脸检测,需配置相关参数,以下配置都是在pro文件下添加
1、配置dlib
For anyone using QtCreator, in the .pro file, the following will work:
INCLUDEPATH += /home/username/dlib-19.13
LIBS += -L/home/username/dlib-19.13
LIBS += -lpthread
LIBS += -lpng -ljpeg
CONFIG += link_pkgconfig
PKGCONFIG += x11
QMAKE_CXXFLAGS += -std=c++11 -DDLIB_PNG_SUPPORT -DDLIB_JPEG_SUPPORT
SOURCES += /home/username/dlib-19.13/dlib/all/source.cpp

2、配置opencv
INCLUDEPATH += /usr/local/include/opencv \
                /usr/local/include/opencv2
LIBS += /usr/local/lib/libopencv_core.so \
        /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_imgproc.so

3、配置后可正常使用

注:上面username改为你linux下用户名

你可能感兴趣的:(Linux)