新手求教,怎样能将opencv配置到qt里
2个回答
展开全部
在你的pro文件里
OPENCV_PATH = C:/opencv/build # 你的opencv folder
INCLUDEPATH += $${OPENCV_PATH}/include \
$${OPENCV_PATH}/include/opencv \
$${OPENCV_PATH}/include/opencv2
CONFIG(release, debug|release) {
LIBS += $${OPENCV_PATH}/x64/vc11/lib/opencv_highgui249.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_imgproc249.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_core249.lib
# .... 你想用的库 release 版本 /x64, /vc11 对应你的编译器版本
}
CONFIG(debug, debug|release) {
LIBS += $${OPENCV_PATH}/x64/vc11/lib/opencv_highgui249d.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_imgproc249d.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_core249d.lib
# .... 你想用的库 debug 版本, /x64, /vc11 同上
}
OPENCV_PATH = C:/opencv/build # 你的opencv folder
INCLUDEPATH += $${OPENCV_PATH}/include \
$${OPENCV_PATH}/include/opencv \
$${OPENCV_PATH}/include/opencv2
CONFIG(release, debug|release) {
LIBS += $${OPENCV_PATH}/x64/vc11/lib/opencv_highgui249.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_imgproc249.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_core249.lib
# .... 你想用的库 release 版本 /x64, /vc11 对应你的编译器版本
}
CONFIG(debug, debug|release) {
LIBS += $${OPENCV_PATH}/x64/vc11/lib/opencv_highgui249d.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_imgproc249d.lib \
$${OPENCV_PATH}/x64/vc11/lib/opencv_core249d.lib
# .... 你想用的库 debug 版本, /x64, /vc11 同上
}
展开全部
只要在pro文件里面加上
INCLUDEPATH += /usr/local/include \
/usr/local/include/opencv2
LIBS += /usr/local/lib/libopencv_highgui.so \
/usr/local/lib/libopencv_core.so
以上是ubuntu下面的,win下面的也差不多就是找到路径就可以。
如果是控制台程序,在main.c里面加上头文件:
#include <QCoreApplication>
#include <highgui/highgui.hpp>//包含opencv库头文件
#include <cv.hpp>
#include <video/video.hpp>
这种形式,要用到哪些头文件加哪些。
具体可以看我的博客:
http://blog.csdn.net/qq_34917736/article/details/77345214
INCLUDEPATH += /usr/local/include \
/usr/local/include/opencv2
LIBS += /usr/local/lib/libopencv_highgui.so \
/usr/local/lib/libopencv_core.so
以上是ubuntu下面的,win下面的也差不多就是找到路径就可以。
如果是控制台程序,在main.c里面加上头文件:
#include <QCoreApplication>
#include <highgui/highgui.hpp>//包含opencv库头文件
#include <cv.hpp>
#include <video/video.hpp>
这种形式,要用到哪些头文件加哪些。
具体可以看我的博客:
http://blog.csdn.net/qq_34917736/article/details/77345214
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询