This is a silly little hack built atop OpenNi's user tracking example which is modified to dump skeletal information to standard output.
It's probably useful if you want to quickly get skeletal dumping working.
This software uses the CMake build system. It requires that the OpenNi libraries be installed (along with the NITE binaries; find your own mirror). In addition, OpenGL and GLUT must be available.
$ git clone https://github.com/rjw57/openni-skeleton-export.git
$ cd openni-skeleton-export
$ mkdir build
$ cd build
$ cmake ..
$ make && ./glskelview
Note that the path to SamplesConfig.xml is hard-coded into the program and so it must be run from the build directory. (Sorry, it's a hack.)
This project includes two utilities: glskelview
and logskel
. The former
is an OpenGL based utility to check your sensor is pointing in the right
direction and to show tracker skeletons. It can also be used to play back
recorded sensor data to check that tracking will succeed. The later is used to
actually export the tracked skeleton information, depth data and per-pixel user
labels to a log.
This utility takes no command-line options aside from an optional path to a
.oni
-format recording (as produced by NiViewer
). If no options are
passed, it attempts to stream from the primesense sensor using the
configuration at the hard-coded path of ../Data/SamplesConfig.xml
. Sorry,
this is a horrible hack but reproduces the behaviour of the original
NiUserTracker sample.
This utility takes a number of command line options which may be examined via
logskel --help
. The utility can take either the path to an XML
configuration file for live-streaming from the sensor or the path to a .oni
recording. It can log depth, user-labelling, 3d point clouds and joint
locations to HDF5 files.
For example, to playback recording.oni
for 10 seconds logging to
/tmp/skel.h5
:
$ build/logskel --playback recording.oni --duration 10 --log /tmp/skel.h5
The examples directory contains a selection of example scripts showing how the output from this utility may be parsed and used.
There is an example IPython notebook which shows how to parse the logs generated by this utility.
The
recordings
sub-module links to a git repository with some sample recordings made with the
sensor. If you've not checked out with
--recursive
, you can fetch the recordings via:
$ git submodule init
$ git submodule update
Pull-requests are very welcome.
This software is Apache licensed like the original OpenNi code. See the LICENSE for more information.