Grabbing your own Kinect datasets

1. Preparation

1) You’ll need MRPT compiled with support for Kinect. Either download the precompiled version, install the mrpt-apps (>=0.9.4) Ubuntu package or compile from sources.

2) Make sure Kinect is properly working by running one of the tests, for example, kinect-3d-view. Under GNU/Linux you may need root privileges (executing as “sudo”) to access the camera. To avoid that, install 51-kinect.rules into /etc/udev/rules.d/.

3) Calibrate your Kinect! Only neccesary if you want to reconstruct 3D point clouds with high accuracy.

4) Make sure you have enough free space in some disk partition with bandwidth enough. Prefer native filesystems, that is, e.g. do NOT grab into an NTFS partition from a GNU/Linux OS.

5) Make sure you have installed or compiled the programs: rawlog-grabber, rawlog-edit & RawLogViewer.

2. Grabbing

1) Prepare a configuration file for rawlog-grabber. Start from this template: [MRPT]/share/mrpt/config_files/rawlog-grabber/kinect.ini

Notice that with the default configuration, all data and images will be embedded into one big binary file. This is done to reduce the OS overhead of creating dozens of small files per second, allocate them in the partition tables, etc.

Typically you should disable the option grab_3D_points to reduce the computational load. To regenerate 3D point clouds, use rawlog-edit or the correspondingC++ APIs.

Modify the parameter grab_decimation according to the processing power/bandwidth available in your recording computer. Under ideal conditions, grab_decimation=1 will record all frames.

By the way: You could also simultaneously grab any other set of sensors by adding new sections to the configuration file. See the examples.

2) Execute rawlog-grabber to actually record your dataset, invoking it with your config file as the only argument

rawlog-grabber YOUR_CONFIG_FILE

Press ESC to end the recording. A single big .rawlog file should have been generated with your dataset.

3. Post-processing

1) It’s normally preferred to strip the rawlog so RGB & depth images are stored in a separate directory (“externalize the rawlog“). In this way, the .rawlog file can be entirely loaded into your programs or in RawLogViewer without needing Gbs of RAM, you can inspect the images with any other standard tool, etc.

To do so, execute this command:

rawlog-edit -i INPUT.rawlog -o OUTPUT.rawlog --externalize

Note: MRPT programs expect the external directory with the RGB & depth files to be named like: ${RAWLOG_FILENAME}_Images. This will be normally observed when using MRPT tools, but take it into account when modifying the file names manually.

2) Inspect your dataset with RawLogViewer (see the video below) or load it from your program to start with the real work!