0

目前我正在做一个使用 Kinect 识别人类行为的项目。由于我在Ubuntu工作,需要骨架信息,所以我选择了openNI和NITE。我想用Qt创建一个GUI应用程序,但是我不知道如何在Qt中集成openNI。openNI 和 NITE 的所有示例都运行良好,但我未能在 Qt creator 中构建它们中的任何一个。我真的希望任何人都可以帮助我(说如何在 Qt 创建者中构建 NiUserTracker)。如果有人可以提供一些示例 Qt 项目,我也会感谢它。

我试图在 Qt 创建者中构建 NiUserTracker:.pro 文件的内容:

TEMPLATE = app
CONFIG += console
CONFIG -= qt
INCLUDEPATH += /home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Include

SOURCES += main.cpp \
    SceneDrawer.cpp \
    opengles.cpp

HEADERS += \
    SceneDrawer.h \
    opengles.h

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/release/ -lnimCodecs
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/debug/ -lnimCodecs
else:symbian: LIBS += -lnimCodecs
else:unix: LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/ -lnimCodecs

INCLUDEPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib
DEPENDPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/release/ -lnimMockNodes
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/debug/ -lnimMockNodes
else:symbian: LIBS += -lnimMockNodes
else:unix: LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/ -lnimMockNodes

INCLUDEPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib
DEPENDPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/release/ -lnimRecorder
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/debug/ -lnimRecorder
else:symbian: LIBS += -lnimRecorder
else:unix: LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/ -lnimRecorder

INCLUDEPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib
DEPENDPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/release/ -lOpenNI
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/debug/ -lOpenNI
else:symbian: LIBS += -lOpenNI
else:unix: LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/ -lOpenNI

INCLUDEPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib
DEPENDPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/release/ -lOpenNI
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/debug/ -lOpenNI
else:symbian: LIBS += -lOpenNI
else:unix: LIBS += -L$$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib/ -lOpenNI

INCLUDEPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib
DEPENDPATH += $$PWD/../../../../../../../../../../home/myname/Kinect/OpenNI-Bin-Dev-Linux-x86-v1.5.4.0/Lib

我添加了 openNI 和 libs 的包含路径,但是当我构建程序时,它显示:

SceneDrawer.o: In function `initTexture(void**, int&, int&)':
SceneDrawer.cpp:(.text+0x45): undefined reference to `glGenTextures'
SceneDrawer.cpp:(.text+0x9c): undefined reference to `glBindTexture'
SceneDrawer.cpp:(.text+0xb8): undefined reference to `glTexParameteri'
SceneDrawer.cpp:(.text+0xd4): undefined reference to `glTexParameteri'
SceneDrawer.o: In function `DrawRectangle(float, float, float, float)':
SceneDrawer.cpp:(.text+0x144): undefined reference to `glVertexPointer'
SceneDrawer.cpp:(.text+0x160): undefined reference to `glDrawArrays'
SceneDrawer.cpp:(.text+0x165): undefined reference to `glFlush'
SceneDrawer.o: In function `DrawTexture(float, float, float, float)':
SceneDrawer.cpp:(.text+0x19b): undefined reference to `glEnableClientState'
SceneDrawer.cpp:(.text+0x1bf): undefined reference to `glTexCoordPointer'
SceneDrawer.o: In function `glPrintString(void*, char*)':
SceneDrawer.cpp:(.text+0x22f): undefined reference to `glutBitmapCharacter'
SceneDrawer.o: In function `DrawLimb(unsigned int, XnSkeletonJoint, XnSkeletonJoint)':
SceneDrawer.cpp:(.text+0x24c): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x306): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x3da): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x488): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x5ab): undefined reference to `g_DepthGenerator'
SceneDrawer.cpp:(.text+0x5ef): undefined reference to `glVertex3i'
SceneDrawer.cpp:(.text+0x62b): undefined reference to `glVertex3i'
SceneDrawer.cpp:(.text+0x65a): undefined reference to `g_UserGenerator'
SceneDrawer.o: In function `drawCircle(float, float, float)':
SceneDrawer.cpp:(.text+0x7e0): undefined reference to `glBegin'
SceneDrawer.cpp:(.text+0x841): undefined reference to `glVertex2f'
SceneDrawer.o: In function `DrawJoint(unsigned int, XnSkeletonJoint)':
SceneDrawer.cpp:(.text+0x869): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x91d): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x9d2): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0xabf): undefined reference to `g_DepthGenerator'
SceneDrawer.o: In function `DrawDepthMap(xn::DepthMetaData const&, xn::SceneMetaData const&)':
SceneDrawer.cpp:(.text+0xdb7): undefined reference to `g_bDrawPixels'
SceneDrawer.cpp:(.text+0xf0c): undefined reference to `g_bDrawBackground'
SceneDrawer.cpp:(.text+0xf85): undefined reference to `glBindTexture'
SceneDrawer.cpp:(.text+0xfd4): undefined reference to `glTexImage2D'
SceneDrawer.cpp:(.text+0xff8): undefined reference to `glColor4f'
SceneDrawer.cpp:(.text+0x1004): undefined reference to `glEnable'
SceneDrawer.cpp:(.text+0x1052): undefined reference to `glDisable'
SceneDrawer.cpp:(.text+0x108f): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x10d1): undefined reference to `g_bDrawSkeleton'
SceneDrawer.cpp:(.text+0x10f4): undefined reference to `g_bPrintID'
SceneDrawer.cpp:(.text+0x1107): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x1114): undefined reference to `g_DepthGenerator'
SceneDrawer.cpp:(.text+0x115b): undefined reference to `g_bPrintState'
SceneDrawer.cpp:(.text+0x11d6): undefined reference to `glColor4f'
SceneDrawer.cpp:(.text+0x1210): undefined reference to `glRasterPos2i'
SceneDrawer.cpp:(.text+0x121b): undefined reference to `glutBitmapHelvetica18'
SceneDrawer.cpp:(.text+0x1225): undefined reference to `g_bDrawSkeleton'
SceneDrawer.cpp:(.text+0x1233): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x1348): undefined reference to `glColor4f'
SceneDrawer.cpp:(.text+0x134e): undefined reference to `g_bMarkJoints'
SceneDrawer.cpp:(.text+0x1362): undefined reference to `glBegin'
SceneDrawer.cpp:(.text+0x154b): undefined reference to `glEnd'
SceneDrawer.cpp:(.text+0x155a): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x187a): undefined reference to `g_UserGenerator'
SceneDrawer.cpp:(.text+0x1b02): undefined reference to `g_bPrintFrameID'
SceneDrawer.cpp:(.text+0x1b87): undefined reference to `glColor4f'
SceneDrawer.cpp:(.text+0x1b9b): undefined reference to `glRasterPos2i'
SceneDrawer.cpp:(.text+0x1baa): undefined reference to `glutBitmapHelvetica18'
SceneDrawer.o: In function `DrawTexture(float, float, float, float)':
SceneDrawer.cpp:(.text+0x1f3): undefined reference to `glDisableClientState'
SceneDrawer.o: In function `drawCircle(float, float, float)':
SceneDrawer.cpp:(.text+0x854): undefined reference to `glEnd'
collect2: ld returned 1 exit status

我想这是因为不包括过剩库。然而,这两个库都是 .lib 文件,似乎无法在 Qt 创建者中添加......

非常感谢!

4

1 回答 1

0

您是否尝试过将 openNI 与 openCV + qt 支持一起使用?另一个解决方案是这个。

http://develnoter.blogspot.com.br/2012/05/integrating-opencv-in-qt-gui.html

于 2013-06-28T17:48:00.430 回答