Code Monkey home page Code Monkey logo

openni2's Introduction

This repository is no longer maintained.

Issue reports and pull requests will not be attended. There are volunteers who are now maintaining OpenNI such as listed below, so please work with them.

openni2's People

Contributors

alpsc avatar eddiecohen avatar eranws avatar maswag avatar tomoto avatar zivhendel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openni2's Issues

What driver properties does NiTE require?

I am the developer of piedar/OpenNI2-FreenectDriver. The driver works fine with the OpenNI 2.2 samples, but running any of the NiTE 2.2 samples results in a segmentation fault in FreenectDriver::DepthStream::getProperty(int, void*, int*), called from oni::implementation::VideoStream::getProperty(int, void*, int*) (full backtrace at piedar/OpenNI2-FreenectDriver#22). Please tell me which properties NiTE requires so I can implement them.

Help with installation of OpenNI2, NiTE and OpenCV

Hi all,
first excuse my English.
I have long reading and trying to install unsuccessfully OpenNI2, Nite2 and OpenCV. Something I'm doing wrong.

I'm using Ubuntu 12.04.03 LTS 32 bits with Microsoft Kinect. Then I explain the steps I followed.

I installed libfreenect 0.2.0+dfsg-2 with all its dependencies. I have run glview and it works perfect.

From now on I am lost.

I do not know if it is mandatory to install OpenNI2-FreenectDriver and just after OpenNI2-master or to install OpenNi2-master and add to directories ~/Driver/ the library libFreenectDriver.so

I also lost when installing OpenNI2-master.

STEP1. Run: make
STEP2. Go into the directory 'Packaging' and run ./ReleaseVersion.py x86

And then, what I have to do?

If I asked something obvious excuse me. I've been looking for several months and I can not enlighten.

I appreciate any help I can offer.

Thank you very much. A greeting

master branch does not build

Hi,

the develop branch works fine, but in master, there are 3 easy-fix issues:

  • -Werror with unused typedef
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Drivers/PSLink'
g++ -MD -MP -MT "./../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.d ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -I. -IProtocols/XnLinkProto -ILinkProtoLib  -fPIC -fvisibility=hidden -Werror -o ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from LinkProtoLib/XnLinkMsgEncoder.h:6:0,
                 from LinkProtoLib/XnLinkControlEndpoint.h:5,
                 from LinkProtoLib/XnLinkControlEndpoint.cpp:1:
LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
 #define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
                                           ^
LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
   XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
   ^
cc1plus: all warnings being treated as errors
  • Another -Werror with unused typedef
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Drivers/PSLink/PSLinkConsole'
g++ -MD -MP -MT "./../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.d ../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../../Include -I../../../../ThirdParty/PSCommon/XnLib/Include -I../ -I../Protocols/XnLinkProto -I../LinkProtoLib  -fPIC -fvisibility=hidden -Werror -o ../../../../Bin/Intermediate/x64-Release/PSLinkConsole/XnLinkControlEndpoint.o ../LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from ../LinkProtoLib/XnLinkMsgEncoder.h:6:0,
                 from ../LinkProtoLib/XnLinkControlEndpoint.h:5,
                 from ../LinkProtoLib/XnLinkControlEndpoint.cpp:1:
../LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
../LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
 #define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
                                           ^
../LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
   XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
   ^
cc1plus: all warnings being treated as errors
  • Linker error because -lpthread is missing
make[1]: Entering directory `/home/niklas/openni/master/OpenNI2/Source/Tools/NiViewer'
g++ -o ../../../Bin/x64-Release/NiViewer ./../../../Bin/Intermediate/x64-Release/NiViewer/Device.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Draw.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Keyboard.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Menu.o ./../../../Bin/Intermediate/x64-Release/NiViewer/MouseInput.o ./../../../Bin/Intermediate/x64-Release/NiViewer/NiViewer.o ./../../../Bin/Intermediate/x64-Release/NiViewer/Capture.o -L../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release -L../../../Bin/x64-Release -lglut -lGL -lOpenNI2 -lXnLib -Wl,-rpath ./
/usr/bin/ld: ../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxMutex.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Thanks!

Compiling OpenNI2-2.0.0.30 on mac fails: struct Version in OpenNI.h clashes with Version() in PS1080Console.cpp

With the g++ that comes with XCode,
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
compiling 5b88c95 fails for me as follows:

g++ -x c++ -c  -arch i386 -arch x86_64 -msse3 -arch i386 -arch x86_64 -msse3 -Wall -O2 -DNDEBUG -I../../../../Include -I../../../../ThirdParty/PSCommon/XnLib/Include -I../Include -I/opt/local/include  -fPIC -fvisibility=hidden -o ../../../../Bin/Intermediate/x64-Release/PS1080Console/PS1080Console.o PS1080Console.cpp
../../../../Include/OpenNI.h: In function ‘int main(int, char**)’:
../../../../Include/OpenNI.h:55: error: ‘openni::Version’ is not a function,
PS1080Console.cpp:140: error:   conflict with ‘bool Version(openni::Device&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)’
PS1080Console.cpp:1676: error:   in call to ‘Version’
../../../../Include/OpenNI.h: At global scope:
../../../../Include/OpenNI.h:90: warning: ‘openni::ANY_DEVICE’ defined but not used

I work around this with a patch https://gist.github.com/dankegel/6709167 that renames the function to be PrintVersion().

Distribution archive is assigned wrong name due to empty PRODUCT_STRING

The Makefile uses the default Python interpreter instead of a Python 2.x interpreter in order to construct the PRODUCT_STRING, which is used for naming the distribution archive. See http://www.python.org/dev/peps/pep-0394, here python2 should be used for interpreting python commands that are source-incompatible with Python3.

Here is the patch:

diff --git a/Makefile b/Makefile
index a436a84..d0d47d0 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@ ifeq ("$(OSTYPE)","Darwin")
 else
        OS_NAME = Linux
 endif
-PRODUCT_STRING = OpenNI-$(OS_NAME)-$(PLATFORM)-$(shell cd Packaging && python -c "import UpdateVersion; print UpdateVersion.getVersion
+PRODUCT_STRING = OpenNI-$(OS_NAME)-$(PLATFORM)-$(shell cd Packaging && python2 -c "import UpdateVersion; print UpdateVersion.getVersio
 FINAL_DIR = Packaging/Final

 OPENNI = Source/Core

Related to issue #48

Building with older compilers (e.g. current g++ in Xcode) fails compiling XN_API_DEPRECATED

When using g++ (as opposed to c++), which reports itself as
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
the build fails with
../Include/XnOS.h:445: error: wrong number of arguments specified for 'deprecated' attribute

I currently use this patch to work around it:

--- a/ThirdParty/PSCommon/XnLib/Include/Linux-x86/XnPlatformLinux-x86.h
+++ b/ThirdParty/PSCommon/XnLib/Include/Linux-x86/XnPlatformLinux-x86.h
@@ -176,7 +176,11 @@ typedef size_t XnSizeT;
#define XN_API_IMPORT

/** Indicates a deprecated function */
+#if defined(clang) || (GNUC > 4 || (GNUC == 4 && (GNUC_MINOR > 4)))
#define XN_API_DEPRECATED(msg) attribute((deprecated("This function is deprecated: " msg)))
+#else
+#define XN_API_DEPRECATED(msg)
+#endif

#define XN_DEPRECATED_WARNING_IDS
#define XN_HIDES_PARENT_METHOD_WARNING_ID

ONI_EXPORT_DRIVER macro uses undeclared XN_NEW and XN_DELETE

In OniDriverAPI.h, the ONI_EXPORT_DRIVER macro references the XN_NEW and XN_DELETE macros, but these are not declared at that point. This only shows up if you call ONI_EXPORT_DRIVER without including XnLib, which I am trying to do.

I replaced the XN_* macros with simple new and delete and it works fine for me. I'm constantly confused as to the necessity of many parts of XnLib... much of it seems like an exercise in unnecessary abstraction now that the core is in C++.

Segfault on shutdown

I am seeing a segfault in:

XnDeviceEnumeration::Shutdown () at Sensor/XnDeviceEnumeration.cpp:101

  • This is occurring in a multithreaded app where OpenNI::initialize() and OpenNI::shutdown() are being called from the main thread.
  • I'm seeing this crash, consistently when run on Mac and Linux (Ubuntu 12.04)
  • I've double-checked, and shutdown() is only being called once.
  • This is off commit ecffeaa... (Update version to 2.3.0.4) though I saw the same behavior with 2.2.0.30

Introspecting in gdb, I'm seeing:

(gdb) p ms_aRegistrationHandles
$1 = {
_vptr$Array = 0x10fc975e0,
m_pData = 0x10ed15990,
m_nSize = 4,
m_nAllocatedSize = 8
}
(gdb) p *ms_aRegistrationHandles.m_pData
$2 = (struct XnRegistrationHandleImpl *) 0x2000000000000000

Sharing device between applications still possible?

I've done a cursory scan of the repo and docs for anything similar to the 'Sharing Devices Between Applications and Locking Nodes' functionality from OpenNI 1.5, but can't find anything. Does OpenNI2 still have a mode for sharing a single device between multiple applications?

More specifically, I am looking to run an OpenNI2-based application and a NiTE2-based application simultaneously, both fed by the same Kinect.

What's happening with this repository once OpenNI is offline?

At the end of april OpenNI is not going to be available anymore. What does this mean for people who are still using OpenNI in software- is it going to be prohibited from then on? What's happenin with this repository- is it going to be maintained by OpenNI? Is it legal to copy it to another repository and continue developing it in pure open source style?

Not sure this is the right spot to ask this.

Yours,
Marcel

README freeGLUT3

README says

But on the referred page the latest version is 2.8.0 ...
It is probably Debian that has confusing naming... please rename the section from "FreeGLUT3" to "FreeGLUT" (the apt part is OK since that is what it requires)

Edit: it is even more confusing... on OpenSuSE the library is called
'libglut3' but the developers package is called 'freeglut-devel' - fun! (both are of cause 2.8.0)

NiViewer has same name in OpenNI

Besides the NiViewer executable, OpenNI and OpenNI2 can be installed on a system side-by-side.

If possible, a new name, such as Ni2Viewer should be selected for NiViewer in OpenNI2.

libglut.so.3: cannot open shared object file

I have trying to install OpenNi, NiTE and try Xtion in Ubuntu Machine,
After installing, when I try to run sample programs in NiTE folder I have got an error saying

libglut.so.3: cannot open shared object file

Please Help !!

NiTE: HandViewer failed assertion in malloc.c

The NiTE 2.2 sample HandViewer aborts with a failed assertion in malloc.c on Linux 3.8.13 with gcc 4.6.3.

HandViewer: malloc.c:2451: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.

Program received signal SIGABRT, Aborted.
0x000000389aa37c15 in raise () from /lib64/libc.so.6
(gdb) backtrace
#0  0x000000389aa37c15 in raise () from /lib64/libc.so.6
#1  0x000000389aa3908b in abort () from /lib64/libc.so.6
#2  0x000000389aa7cb2d in ?? () from /lib64/libc.so.6
#3  0x000000389aa7f8eb in ?? () from /lib64/libc.so.6
#4  0x000000389aa81545 in malloc () from /lib64/libc.so.6
#5  0x000000389c2bc13d in operator new(unsigned long) () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/libstdc++.so.6
#6  0x00007ffff781da78 in NHAGestureRecognizerManager::Initialize(NACommonData*, xn::DepthGenerator const&, xn::DepthMetaData const&, std::string const&, int, int) ()
   from ./libNiTE2.so
#7  0x00007ffff7497663 in HandTracker::initializeTracker() () from ./libNiTE2.so
#8  0x00007ffff749860e in niteInitializeHandTrackerByDevice () from ./libNiTE2.so
#9  0x00000000004024f0 in SampleViewer::Init(int, char**) ()
#10 0x00000000004020ed in main ()

GCC 4.8 fails due to -Werror and XN_COMPILER_ASSERT()

Making results in this error:

$ make
make -C ThirdParty/PSCommon/XnLib/Source
make[1]: Entering directory `/home/pixio/OpenNI2/ThirdParty/PSCommon/XnLib/Source'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pixio/OpenNI2/ThirdParty/PSCommon/XnLib/Source'
make -C Source/Core
make[1]: Entering directory `/home/pixio/OpenNI2/Source/Core'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pixio/OpenNI2/Source/Core'
make -C Source/DepthUtils
make[1]: Entering directory `/home/pixio/OpenNI2/Source/DepthUtils'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pixio/OpenNI2/Source/DepthUtils'
make -C Source/Drivers/DummyDevice
make[1]: Entering directory `/home/pixio/OpenNI2/Source/Drivers/DummyDevice'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pixio/OpenNI2/Source/Drivers/DummyDevice'
make -C Source/Drivers/PS1080
make[1]: Entering directory `/home/pixio/OpenNI2/Source/Drivers/PS1080'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pixio/OpenNI2/Source/Drivers/PS1080'
make -C Source/Drivers/PSLink
make[1]: Entering directory `/home/pixio/OpenNI2/Source/Drivers/PSLink'
g++ -MD -MP -MT "./../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.d ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -I. -IProtocols/XnLinkProto -ILinkProtoLib  -fPIC -fvisibility=hidden -Werror -o ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from LinkProtoLib/XnLinkMsgEncoder.h:6:0,
                 from LinkProtoLib/XnLinkControlEndpoint.h:5,
                 from LinkProtoLib/XnLinkControlEndpoint.cpp:1:
LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
 #define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
                                           ^
LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
   XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
   ^
cc1plus: all warnings being treated as errors
make[1]: *** [../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o] Error 1
make[1]: Leaving directory `/home/pixio/OpenNI2/Source/Drivers/PSLink'
make: *** [Source/Drivers/PSLink] Error 2

It's complaining about XN_COMPILER_ASSERT()'s expansion and that compileAssert is not used (though it is defined locally). GCC 4.8 warns about typedefs (due to -Wunused-local-typedefs) that are locally defined but not used, and since -Werror is specified this results in a failed compilation.

Adding -Wno-unused-local-typedefs to the compilation options fixes the issue.

$ g++ --version
g++ (Ubuntu/Linaro 4.8.1-10ubuntu6) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux photonn 3.11.0-11-generic #17-Ubuntu SMP Tue Oct 1 19:42:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

NiViewer segfaults when compiled with -O2

When setting the stream to a certain frame (using the ":" shortcut on the keyboard), the NiViewer segfaults. My own code using the seek method in openni::PlaybackControl segfaults as well.

I can reliably reproduce the segmentation fault: it appears when OpenNI2 is compiled with optimization turned on (-O2, i.e. Release mode). Everything works fine when compiling OpenNI2 with optimization disabled (-O0, i.e. Debug mode).

  • OpenNI2: commit 5b88c95
  • g++ (GCC) 4.8.1 20130725 (prerelease)
  • Linux 3.11.4-1-ARCH x86_64 GNU/Linux

I tried the following configurations:

  • works: CFLAGS += -O0 -DNDEBUG
  • segfaults: CFLAGS += -DNDEBUG
  • segfaults: CFLAGS += -O2
  • segfaults: CFLAGS += -O2 -DNDEBUG
  • segfaults: CFLAGS += -O2 -DNDEBUG
  • segfaults: CFLAGS += -g -O2

Unfortunately, the stacktrace in GNU debugger did not tell me very much even though I compiled with the debug symbols enabled:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeb501700 (LWP 662)]
0x00007ffff22eb230 in ?? () from /usr/lib/OpenNI2/Drivers/libOniFile.so
(gdb) bt
#0  0x00007ffff22eb230 in ?? () from /usr/lib/OpenNI2/Drivers/libOniFile.so
#1  0x00007ffff22f01e7 in ?? () from /usr/lib/OpenNI2/Drivers/libOniFile.so
#2  0x00007ffff22f0289 in ?? () from /usr/lib/OpenNI2/Drivers/libOniFile.so
#3  0x00007ffff73cf0a2 in start_thread () from /usr/lib/libpthread.so.0
#4  0x00007ffff68e443d in clone () from /usr/lib/libc.so.6

RaspberryPi Compilation

Compilation under RaspberryPi currently fails. I have created a pull request (#9) with the patches to make it work.
Maybe someone can have a look at these patches and integrate these?

Kind regards

Hauke

Registration mode and offline reconstruction point cloud

Hi guys,

I have two issues which I need your help to solve them. First, I used function setImageRegistrationMode( openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR ) to calibrate depth to color, but I found the depth's size after calibrated was smaller than original and the reconstructed point cloud was shrunk as well. So if there is a function to calibrate image to depth to solve this problem?

Second, I used function convertDepthToWorld or convertWorldToDepth to realize conversion between depth and world, but it needs depth VideoStream as a parameter. Currently I want to utilize these functions in offline mode, but I can not provide VideoStream which generated during device initialization process, so does anyone know some methods to avoid this limitation and process depth and color files offline? Thanks very much!

Best,

shawn

OpenNI2 packaging scripts are source-incompatible with Python3

The python scripts Packaging/ReleaseVersion.py and Packaging/Harvest.py are only compatible with Python 2.x. Hence, the interpreters should be set to python2 rather than python in the corresponding shebang. See PEP 0394 http://www.python.org/dev/peps/pep-0394 for the rationale. On Arch Linux which afaik is the first distro to adopt Python3 as default (other distros will follow suit sooner or later), the packaging scripts of OpenNI2 fail.

Here is the patch:

diff --git a/Packaging/Harvest.py b/Packaging/Harvest.py
index 4ce9ed2..42b3d61 100755
--- a/Packaging/Harvest.py
+++ b/Packaging/Harvest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2

 #/****************************************************************************
 #*                                                                           *
diff --git a/Packaging/ReleaseVersion.py b/Packaging/ReleaseVersion.py
index e2fdf5f..3ba2cf3 100755
--- a/Packaging/ReleaseVersion.py
+++ b/Packaging/ReleaseVersion.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2

 #/****************************************************************************
 #*       

Can not read IR image and RGB image simultaneously?

I'm working on Asus's Xtion. recently, I'm trying to read IR image and RGB image at the same time. but I can start the IR stream after starting a RGB stream. has any one encounter the same problem? is there any solution for it?
thanks~~~

Compilation error: unused local typedef

When compiling OpenNI2 (commit 5b88c9) with g++ (GCC) 4.8.1 20130725 (prerelease), I receive the following compilation error:

g++ -MD -MP -MT "./../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.d ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o" -c -msse3 -Wall -O2 -DNDEBUG -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -I. -IProtocols/XnLinkProto -ILinkProtoLib  -fPIC -fvisibility=hidden -Werror -o ../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o LinkProtoLib/XnLinkControlEndpoint.cpp
In file included from LinkProtoLib/XnLinkMsgEncoder.h:6:0,
                 from LinkProtoLib/XnLinkControlEndpoint.h:5,
                 from LinkProtoLib/XnLinkControlEndpoint.cpp:1:
LinkProtoLib/XnLinkControlEndpoint.cpp: In member function ‘XnStatus xn::LinkControlEndpoint::EnumerateStreams(xnl::Array<XnFwStreamInfo>&)’:
LinkProtoLib/XnLinkProtoUtils.h:18:43: error: typedef ‘compileAssert’ locally defined but not used [-Werror=unused-local-typedefs]
 #define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
                                           ^
LinkProtoLib/XnLinkControlEndpoint.cpp:1174:3: note: in expansion of macro ‘XN_COMPILER_ASSERT’
   XN_COMPILER_ASSERT(sizeof(aStreamInfos[i].creationInfo) >= sizeof(pEnumerateNodesResponse->m_streamInfos[i].m_strCreationInfo));
   ^
cc1plus: all warnings being treated as errors
make[1]: *** [../../../Bin/Intermediate/x64-Release/libPSLink.so/XnLinkControlEndpoint.o] Error 1
make[1]: Leaving directory 

A workaround is to disable the treatment of warnings as errors, here is the patch:

diff --git a/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile b/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile
index af28ecc..f1a5e38 100644
--- a/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile
+++ b/ThirdParty/PSCommon/BuildSystem/CommonCppMakefile
@@ -73,7 +73,7 @@ CFLAGS += $(INC_DIRS_OPTION) $(DEFINES_OPTION)
 CFLAGS += -fPIC -fvisibility=hidden

 ifneq "$(ALLOW_WARNINGS)" "1"
-       CFLAGS += -Werror
+       CFLAGS += -Werror -Wno-error=unused-local-typedefs
 endif

 LDFLAGS += $(LIB_DIRS_OPTION) $(USED_LIBS_OPTION)

Recording/playing in RGB 888 does not work with Primesense/Xtion Pro

I have an Xtion Pro and also a Primesense camera.

If in NiViewer, I set Device -> Streams -> Depth -> Video Mode -> 640 x 480 and Device -> Streams -> Color -> Video Mode -> 640 x 480 @ 30 (RGB 888), and press s to start recording and after a while x to stop recording, the produced Captured.oni cannot be played back with ./NiViewer Captured.oni.

It hangs at the first frame of the playback, displaying the first depth frame and a completely black color frame.

It works if I switch to YUV and Grayscale, but RGB 888 never works.

Is this supposed to work or do my cameras only support YUV?

Compile issues on Debian 6

Hi,
I' m having some compile error for branch master on Debian 6 x86

g++ -MD -MP -MT "./../../../Bin/Intermediate/x86-Release/libPS1080.so/XnDepthStream.d ../../../Bin/Intermediate/x86-Release/libPS1080.so/XnDepthStream.o" -c -msse3 -Wall -O2 -DNDEBUG -I. -IInclude -I../../../Include -I../../../ThirdParty/PSCommon/XnLib/Include -fPIC -fvisibility=hidden -o ../../../Bin/Intermediate/x86-Release/libPS1080.so/XnDepthStream.o DDK/XnDepthStream.cpp
In file included from ./DDK/XnFrameBufferManager.h:29,
from ./DDK/XnFrameStream.h:28,
from ./DDK/XnPixelStream.h:27,
from DDK/XnDepthStream.h:27,
from DDK/XnDepthStream.cpp:24:
./DDK/XnOniFramePool.h: In constructor ‘XnOniFramePool::XnOniFramePool()’:
./DDK/XnOniFramePool.h:45: error: class ‘XnOniFramePool’ does not have any field named ‘Pool’
./DDK/XnOniFramePool.h: In member function ‘virtual XnStatus XnOniFramePool::Release(OniFrame_)’:
./DDK/XnOniFramePool.h:61: error: ‘Pool’ has not been declared
In file included from ./DDK/XnFrameStream.h:28,
from ./DDK/XnPixelStream.h:27,
from DDK/XnDepthStream.h:27,
from DDK/XnDepthStream.cpp:24:
./DDK/XnFrameBufferManager.h: At global scope:
./DDK/XnFrameBufferManager.h:71: error: type ‘xnl::EventXnFrameBufferManager::NewFrameEventArgs’ is not derived from type ‘XnFrameBufferManager’
./DDK/XnFrameBufferManager.h:71: error: expected ‘;’ before ‘&’ token
./DDK/XnFrameBufferManager.h:73: error: expected ‘;’ before ‘private’
make[1]: *_* [../../../Bin/Intermediate/x86-Release/libPS1080.so/XnDepthStream.o] Error 1

I'm using gcc 4.4.7

Anyone else had those errors?

Thanks

NiTE: UserViewer segfaults on exit

The NiTE 2.2 sample UserViewer segfaults on exit on Linux 3.8.13 with gcc 4.6.3.

Program received signal SIGSEGV, Segmentation fault.
0x000000389aa7d6dd in ?? () from /lib64/libc.so.6
(gdb) backtrace
#0  0x000000389aa7d6dd in ?? () from /lib64/libc.so.6
#1  0x000000389aa7e1f8 in ?? () from /lib64/libc.so.6
#2  0x00007ffff74ffea4 in NACommonData::~NACommonData() () from ./libNiTE2.so
#3  0x00007ffff748f711 in UserTracker::~UserTracker() () from ./libNiTE2.so
#4  0x00007ffff748fc09 in UserTracker::~UserTracker() () from ./libNiTE2.so
#5  0x00007ffff7493677 in niteShutdownUserTracker () from ./libNiTE2.so
#6  0x000000000040248a in SampleViewer::Finalize() ()
#7  0x000000000040251b in SampleViewer::OnKey(unsigned char, int, int) ()
#8  0x00007ffff7db0c5d in glutMainLoopEvent () from /usr/lib64/libglut.so.3
#9  0x00007ffff7db1025 in glutMainLoop () from /usr/lib64/libglut.so.3
#10 0x0000000000401ef9 in SampleViewer::Run() ()
#11 0x0000000000401d89 in main ()

Gcc 4.7 problems

I would like to report that the project does not compile with gcc4-7 .Issuing make CXX=g++-4.6 everything works.

develop branch does not build on Linux gcc 4.6

The master compiles but the develop branch gives me a lot of multiple definitions

In function `xnOSCountFiles': 
XnLinuxFiles.cpp:(.text+0x0): multiple definition of `xnOSCountFiles'
../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxFiles.o):XnLinuxFiles.cpp:(.text+0x0): first defined here
../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxFiles.o): In function `xnOSGetFileList':
XnLinuxFiles.cpp:(.text+0x60): multiple definition of `xnOSGetFileList'
../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxFiles.o):XnLinuxFiles.cpp:(.text+0x60): first defined here
../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxFiles.o): In function `xnOSOpenFile':
XnLinuxFiles.cpp:(.text+0x180): multiple definition of `xnOSOpenFile'
../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxFiles.o):XnLinuxFiles.cpp:(.text+0x180): first defined here

Compiling OpenNI2-2.0.0.30 on mac with clang fails: macro equivalent() in ThirdParty/GL/glh/glh_linear.h clashes with llvm::sys::fs::equivalent

I'm guessing here, but the define

define equivalent(a,b) (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false)

in OpenNI2-2.2.0.30/ThirdParty/GL/glh/glh_linear.h seems to be causing build
failure with clang, possibly because it clashes with llvm::sys::fs::equivalent.

Simply changing equivalent to something else, like glh_equiv, works around
the problem. Here's a patch we use for this here:

http://kegel.com/equiv-is-a-thing-for-clang-apparently.patch

Memory leak of device generated frame

I am working on my device module for OpenNI 2.2 Alpha(lastest source code).

I use NiViewer to test the Dummy device by excute the command "NiViewer.exe Dummy", and found that the memory usage is increasing fast.
After tracking the code, I found that the OniFrameInternal::refCount will never be zero, so the frame never been released.

According to the "DummyDevice" sample, it looks like that the stream should :

  1. use "getServices().acquireFrame()" to generate a new OniFrame pointer.
  2. after fill all data to OniFrame, call raiseNewFrame() to trigger a new frame event

But if only do these, the created frame seem never been released.
If I release the frame by calling "getServices().releaseFrame()" after raiseNewFrame(), the problem semm be fixed.
Is this the correct way to generate a new frame?

I works in Visual C++ 2012 on Windows 7 x64.
Could someone please test this?

thanks.

Source code download URL / repository tags

I am a manager of the MacPorts project and we have been asked to include openni2 in MacPorts. (We already have openni 1.) What is the intended mechanism for users to download the source code of openni 2.2.0.30, or generally any given version of openni2? I expected to find tags in your github repository, as there were for openni 1, but there aren't any tags here for openni 2.2.x.

[Request] OpenNI2 examples in python

I try to use the python wrapper for OpenNI2 but is very hard to find documentation and examples, so this is a request.

It is possible to include in this repo a folder with the same examples written in C/C++ but in python?

Greentings

OpenNI for Android

Hi, it seems to me, the compilation for android doesn't work.

I have set all the Paths and still get errors. Currently the error tells me the execinfo.h ist not found, if I delete the usage of execinfo.h it tells me that sys/sem.h is not found.

My Paths lead to the following things:

ARM_CXX = android-toolchain/bin/arm-linux-androideabi-g++
ARM_STAGING=android-toolchain/sysroot

So I have no idea how to compile it for android.

Building with older compilers fails on "#pragma GCC diagnostic push"

Older compilers (like the g++ that comes with XCode) complain:

../../../Include/OpenNI.h:88: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’

88 #pragma GCC diagnostic push

../../../Include/OpenNI.h:92: warning: expected [error|warning|ignored] after ‘#pragma GCC diagnostic’

92 #pragma GCC diagnostic pop

The workaround is to not use that pragma with older compilers; here's a patch.
https://gist.github.com/dankegel/6709336

Read: Image buffer is corrupt. Size is 921588 (!= 921600)

Hi,

I'm using the PS1080 driver through OpenNI to capture data from an Xtion PRO Live, which works pefectly on most of the sample software I've tried. In my case, I'm working with FORTH's 3D HandTracker which is somewhat GPU intensive, and I am getting some warning messages from the driver:

1395917999895396 WARNING    Image frame is corrupt!
1395917999962098 WARNING    Read: Image buffer is corrupt. Size is 921588 (!= 921600)

I'm having troubles using the 3D hand tracking library, because it depends on depth and color information, and whenever I get a corrupt frame, it goes unnoticed from the application's point of view (despite the warning log), thus it gets propagated to the tracker and consequently the tracking goes to waste (due to wrong color information and glitches on the image).

Is it possible to repeat last frame in case of buffer corruption, or at least capture this corruption from an OpenNI application in order to prevent the corrupt frame to be propagated or even created?

Thanks in advance!

error while loading shared libraries: libOpenNI2.so

Hi all,
first excuse me for my English.

I'm using Code::Blocks on Linux with OpenCV, OpenNI and NiTE libraries. I'm having some problems I do not know how to fix.

When I build the project, I get:

warning: libOpenNI2.so, needed by ../NiTE-Linux-x86-2.2/Redist/libNiTE2.so, not found (try using-rpath or-rpath-link)

And when I run the project, I get:

/home/jfra/kinect/SistemaOpenNI2 by JFRA v2/bin/Debug/Sistema: error while loading shared libraries: libOpenNI2.so: can not open shared object file: No such file or directory

Process returned 127 (0x7F) execution time: 0.002 s
Press ENTER to continue.

Comment that I have assigned libOpenNI2.so:

Project Build options ...
Linker settings
../OpenNI-Linux-x86-2.2/Redist/libOpenNI2.so

Thank you for your help. A greeting.

Listener attached with VideoStream::addNewFrameListener() captures both streams

When I execute the attached code, I receive only depth frames in my callback. If I move the addNewFrameListener() call to // MOVE HERE, I get both color and depth frames.

openni::Status status = openni::OpenNI::initialize();
if (status != openni::STATUS_OK) throw NIException(status, "OpenNI::initialize()");

status = Device.open(openni::ANY_DEVICE);
if (status != openni::STATUS_OK) throw NIException(status, "Device::open(openni::ANY_DEVICE)");

if (Device.getSensorInfo(openni::SENSOR_COLOR) != nullptr)
{
    status = Video.create(Device, openni::SENSOR_COLOR);
    if (status != openni::STATUS_OK) throw NIException(status, "VideoStream::create(Device, openni::SENSOR_COLOR");

    status = Video.start();
    if (status != openni::STATUS_OK) throw NIException(status, "VideoStream::start()");
}

// MOVE HERE

if (Device.getSensorInfo(openni::SENSOR_DEPTH) != nullptr)
{
    status = Video.create(Device, openni::SENSOR_DEPTH);
    if (status != openni::STATUS_OK) throw NIException(status, "VideoStream::create(Device, openni::SENSOR_DEPTH");

    status = Video.start();
    if (status != openni::STATUS_OK) throw NIException(status, "VideoStream::start()");
}

status = Video.addNewFrameListener(this);
if (status != openni::STATUS_OK) throw NIException(status, "VideoStream::addNewFrameListener(&FrameListener)");

Installation confusion

We've been asked to add a port for openni2 to MacPorts, and I'm trying to do this, but I'm unclear how to install it.

With openni1, it was relatively simple to build with cd Platform/Linux/CreateRedist && CXX=clang++ ./RedistMaker and install with cd ../Redist/* && ./install.sh -c $DESTDIR.

With openni2, I can build with make release ALLOW_WARNINGS=1 CXX=clang but I don't know how to install. The directory Packaging contains a directory OpenNI-MacOSX-x64-2.2 but the install.sh script inside it doesn't install anything; it just creates a text file OpenNIDevEnvironment.

How should we proceed? Why does the Makefile not have an install target like other Makefiles do that puts the files where other programs will expect them to be?

Linking error: need to pass -lpthread to linker

Compiling OpenNI2 (commit 5b88c95) leads to a linker error on my platform:

/usr/bin/ld: ../../../ThirdParty/PSCommon/XnLib/Bin/x64-Release/libXnLib.a(XnLinuxMutex.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/usr/bin/ld: note: 'pthread_mutexattr_settype@@GLIBC_2.2.5' is defined in DSO /usr/lib/libpthread.so.0 so try adding it to the linker command line
/usr/lib/libpthread.so.0: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[1]: *** [../../../Bin/x64-Release/NiViewer] Error 1
  • g++ --version: g++ (GCC) 4.8.1 20130725 (prerelease)
  • uname -mors: Linux 3.11.4-1-ARCH x86_64 GNU/Linux

Here is a patch:

diff --git a/Source/Tools/NiViewer/Makefile b/Source/Tools/NiViewer/Makefile
index 1eba049..1b5714d 100644
--- a/Source/Tools/NiViewer/Makefile
+++ b/Source/Tools/NiViewer/Makefile
@@ -26,7 +26,7 @@ else
 endif

 LIB_DIRS  += ../../../ThirdParty/PSCommon/XnLib/Bin/$(PLATFORM)-$(CFG)
-USED_LIBS += OpenNI2 XnLib
+USED_LIBS += OpenNI2 XnLib pthread

 EXE_NAME = NiViewer

Can't turn of IR in NiViewer after runing

In current version NiViewer, I can't turn on the IR stream after I execute the program.
I must execute NiViewer vai with the commad "-ir=on -color=off", which make color stream not available.
If there is no "-color=off" command, IR will never available.

I know I can only use IR or Color stream in the same time.
But I hope that I can switch IR / Color stream in the runtime, just like the version with OpenNI 2.1.

"ReleaseVersion.py android" on develop branch causes "Can't find ANDROID_CXX and ANDROID_STAGING"

if I try to build the latest android version from the develop branch I get the following error. any ideas how I have to define these vars?

OpenNI2-dev/Packaging$ ./ReleaseVersion.py android
Creating installer for OpenNI 2.3 android
Traceback (most recent call last):
  File "./ReleaseVersion.py", line 196, in <module>
    subprocess.check_call(['make', '-C', '../', '-j' + calc_jobs_number(), 'PLATFORM=' + plat, 'clean'], stdout=devNull, stderr=devNull)
  File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['make', '-C', '../', '-j2', 'PLATFORM=android', 'clean']' returned non-zero exit status 2

if I type the command manually I get:

OpenNI2-dev/Packaging$ make -C ../ -j2 PLATFORM=android clean
make: Entering directory `OpenNI2-dev'
ThirdParty/PSCommon/BuildSystem/CommonDefs.mak:36: *** Cross-Compilation error. Can't find ANDROID_CXX and ANDROID_STAGING.  Stop.
make: Leaving directory `OpenNI2-dev'

about openni2 on android

I want to use openni2 on android , Use c++ write it to shared object (refer libOpenNI2.so).and use my own .so .
The question is i am fail to build packaging at all , just can't pass the step that python .py. so i want know ,if i have openni2-linux-arm.rar ,can i use the libOpenNI2.so on android? i don't know but android is kind of arm right?

in openni1.x there is a /Platform/Android/ path in git so i can just $ndk/ndk-build , in 2.0 how can i done the same effect?

Develop branch does not work with Asus Xtion Pro Live anymore

Hi,

Trying to run the latest develop branch (d5167f5), the Asus Xtion Pro Live device (without any firmware update) does not work anymore, at least on Mac:

./NiViewer
openDevice failed:
Could not open "1d27/0600@26/4": Error!
Press any key to continue . .

Using git bisect, I could identify the commit 4a3a52d "Merge branch ps_1080_new_interface into develop" (22 April 2013) as the faulty change.

The binaries OpenNI 2.2 Alpha (OS X) from OpenNI website also have the same issue. 2.1 beta works fine with the Xtion, but I experience hiccups with Carmine 1.09, which seem to be gone with 2.2 alpha.

Hope this helps,

License confusion

The file LICENSE says the license is Apache 2.0 but the file Packaging/Linux/install.sh says the license is GPL 3 or later. Which is it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.