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:
- git clone https://github.com/mankoff/kinect_record.git && cd kinect_record/
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!