OpenCV 与 Qt 的集成 [英] OpenCV integration With Qt

查看:101
本文介绍了OpenCV 与 Qt 的集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将 openCV 与 QT 集成时遇到问题.我所做的是为 Mac OSX(openCV 版本 3.1.0)安装了 openCV 和 Qt,并转到了 myproject.pro 文件并添加了

I am having a problem integrating my openCV with QT. What I have done is installed openCV and Qt for Mac OSX (openCV version 3.1.0) and have went to the myproject.pro file and have added

#-------------------------------------------------
#
# Project created by QtCreator 2016-05-15T23:16:25
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = cam
TEMPLATE = app




// new
QT       += core
QT       -= gui

TARGET = RP_openCV_01
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app

SOURCES += main.cpp\
        mainwindow.cpp

LIBS += -L/opt/local/lib \
-lopencv_highgui.3.1.0 \
-lopencv_core.3.1.0

INCLUDEPATH += /opt/local/include


HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

我尝试将头文件添加到主 .cpp 并出现错误,指出找不到文件,有人可以向他们解释适当的设置吗?

I have tried to add the header files to the main .cpp and have errors stating files not found, can someone please explain to em the appropriate set-up?

推荐答案

建议您关注 this 用于安装和使用带有 Qt 的 OpenCV.

I suggest you to follow this for installing and using OpenCV with Qt.

确保您编译的 OpenCV 没有 WITH_QT=ON 标志.甚至将其设置为 WITH_QT=OFF 只是为了确保会更好,即使它假设是默认值.

Make sure that you compile your OpenCV without the WITH_QT=ON flag. Will be better even to set it to WITH_QT=OFF just to make sure, even though it suppose to be the default.

这篇关于OpenCV 与 Qt 的集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆