Recording from Kinect for offline Kinect-less development

Fakenect, allows for hacking and playing with the libfreenect library without the need for having an actual Kinect device. Assuming you have a pre-“recorded” data, all that needs to be done is:

fakenect <path_to_data_folder> <your_application> <parameters>

For e.g., if we need to run freenect-glcview, that comes bundled with libfreeenct library, we need to execute it as:

fakenect <path_to_data_folder> freenect-glcview

and we’ll get access to the pre-recorded data as though an actual Kinect device was connected! Now comes the interesting part.. How to record such a data? We could do it using freenect-record that comes bundled with libfreenect, but it doesnt let the user know what is being captured due to absence of any GUI.

kinect_record is a nice little code meant to record and show what is being recorded simultaneously. However, compiling this little gem needs some tweaking to the Makefile.linux that comes bundled along:

search for the location where freenect.h is located in your system:

  • locate libfreenect.h (for my system, its something like: /usr/include/libfreenect/libfreenect.h)

copy the path till libfreenect/ (for my system, it will be: /usr/include/libfreenect/). Open Makefile.linux and edit the CFLAGS variable to look like:

  • CFLAGS=-g -Wall -I/usr/include/libfreenect -I/usr/include

This should be enough in most of the cases. I hit an additional error message: undefined reference to symbol ‘pthread_key_delete GLIBC_2.2.5’. This was resolved using this suggestion and the corresponding edit to LDFLAGS variable makes it look like:

  • LDFLAGS = -lfreenect -lGL -lGLU -lm -lglut -L /lib64 -l pthread

That should be it! Just type make and the executable should be ready. To execute it, type:

  • ./kinect-record <path_to_folder>

and enjoy hacking using libfreenect without needing the actual Kinect device!

Using Skeltrack with Kinect on Fedora 18

Skeltrack is a skeleton tracking library developed by Igalia’s Joaquim Rocha. Developed as a FOSS library, it is very well integrated with Gnome technologies, an example of which is the capability to control Gnome desktop using Skeltrack.

Here, the steps needed to get Skeltrack up and running on your fresh F18 system is detailed. First, install the dependencies using yum:

sudo yum install libfreenect* autoconf automake gobject-introspection-devel gtk-doc */cairo.h

Now we are ready to begin the actual installation. Since, libfreenect lacks the motor control capabilities, GFreenect was developed at Igalia. It is a dependency for Skeltrack, so we need to install it first using the following steps:

  • sudo updatedb
  • export LD_LIBRARY_PATH=/usr/local/lib/
  • export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
  • git clone https://github.com/elima/GFreenect.git
  • cd GFreenect && libtoolize -v –copy –install
  • aclocal
  • autoconf
  • ./autogen.sh
  • ./configure
  • make
  • sudo make install

With this, GFreenect installation should be done. You can test the installation by plugging in Kinect and executing:

  • cd <PATH_TO_GFreenect_FOLDER>/examples
  • python2.7 test*.py

You should get something like this:

GFreenect Demo

Now to install Skeltrack, similar steps are needed:

  • sudo updatedb
  • export LD_LIBRARY_PATH=/usr/local/lib/
  • export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
  • git clone https://github.com/joaquimrocha/Skeltrack.git
  • cd Skeltrack && libtoolize -v –copy –install
  • aclocal
  • autoconf
  • ./autogen.sh
  • ./configure
  • make
  • sudo make install

Thats it! Skeltrack would be up and running on your system :). To test, run:

  • cd <PATH_TO_Skeltrack_FOLDER>/examples
  • ./test-kinect.o

These steps should be enough to get us ready to use the amazing Skeltrack library.. In case you’re even more eager to play around with Kinect and want to show off your gesture skills, install and use Skeltrack-Desktop-Control :

And we’re done. To run the software:

  • cd <PATH_TO_Skeltrack_FOLDER>/src
  • ./skeltrack-desktop-control

Happy Kinect hacking! 🙂