Menu

PCL_Recorder

Lehment

Summary

Program to record PCL point clouds and image series captured with a Microsoft Kinect camera. Stores all data in a newly created directory.

Parameters

  • "--help" - shows help message
  • "--fps INT" - set the desired fps (1-30) for capturing. Note: For higher framerates, images are stored in a queue in memory. If the disk can't keep up, the memory fills up and the program quits.
  • "--maskuser" or "-m" - set this flag to mask the background, showing only the user
  • "--posetracking" or "-p" - set this flag to record skeleton pose gained from NITE middleware (skeleton_FRAME#.dat)
  • "--config_file STRING" or "-c STRING" -path of the OpenNI xml configuration file
  • "destination_file STRING" or "-d STRING" - path under which all results are to be stored
  • "--depth" - flag for storing depth images (*.tif)
  • "--bgr" - flag for storing BGR images (*.tif)
  • "--cloud" - flag for storing the point cloud (*.pcd)

Usage

For recording kinect BGR and depth images with pose tracking and user mask at 20 fps:

PCL_Recorder.ext -c Kinectconfig.xml -d "C:\NewCapture" --fps 20 --maskuser --bgr --depth

The programm uses buffer files to record data. After recording has finished, these buffer files are converted and split into individual files for each frame. Have patience...

There are two definitions in the sourcecode worth noticing:

#define UPPER_QUEUE_SIZE 200

Up to 200 data frames are stored in RAM. If you have more memory available, you can permit more frames to be stored here.

#define MAX_BUFFER_FILE_SIZE 2000

The maximum size of the buffer files written to disk is 2000 MB. Adjust according to your needs.

Output

Skeleton Output to "skeleton_FRAME#.dat". Tracks first available user only.

  • f: frame
  • p: x-y-z position (relative to camera)
  • o: X-Y-Z-W orientation quaternion (relative to camera)
  • c: C tracking confidence (0-1)

BGR output to "bgr_FRAME#.tif". Build from a 3 channel 3 x 8 bit BGR image.

Depth output to "depth_FRAME#.tif". Contains the depth data as a 16bit unsigned integer array. To convert to metric, multiply the data by 0.0001f. Messy, but the cv::Filestorage is just too slow for this job.

Cloud output to "cloud_FRAME#.pcd". Contains a pcl::PointXYZRGB pointcloud. Metric, coordinate system centered on the camera.

Planned Changes

  • Monitoring of memory occupancy to avoid crashes
  • Maybe the second thread (writing from the std::queue to the std::fstream) is not really necessary. Inquire.

Requirements

Compiling:

  • boost 1.46.1
  • PCL 1.3
  • OpenNI 1.3.3
  • NITE 1.3
  • OpenCV 2.3

Running:

  • PCL 1.3
  • OpenNI 1.3.3
  • NITE 1.3
  • OpenCV 2.3

Related

Wiki: Code Overview
Wiki: Kinect_Server_OpenNI