Grabbing your own RGBD camera datasets
Preparation
You will need MRPT compiled with support for Kinect, OpenNI2, or the driver of your specific camera. Either download a Windows precompiled version, install the mrpt-apps Ubuntu package or compile MRPT from sources.
Make sure the camera is properly working by running one of the tests, for example:
apps/kinect-3d-view
samples/hwdrivers_openni2_driver_demo
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/.
Calibrate your Camera!
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.
Make sure you have installed or compiled the programs: rawlog-grabber, rawlog-edit, and RawLogViewer.
Grabbing
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 corresponding C++ 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.
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.
Post-processing
It is 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.
Inspect your dataset with RawLogViewer (see the video below) or load it from your program to start with the real work!