RecFusion SDK
RFSRecorder Class Reference

#include <RFSRecorder.h>

Saves RGB-D sequences in RFS format. More...

Detailed Description

Saves RGB-D sequences in RFS format.

The recorder uses a ring buffer to store the passed in images. In the background a thread is writing the images to disk. To start the thread call start(), to stop it call stop(). If the thread is not running images will be dropped when the ring buffer is full. Frames will also be dropped when the frames cannot be written fast enough to disk. Whether a frame was dropped is indicated by the return value of addFrame()

Public Member Functions

 RFSRecorder (const char *filename)
 Create recorder object. More...
 
 ~RFSRecorder ()
 Destroy recorder object.
 
bool init (int colorWidth, int colorHeight, int depthWidth, int depthHeight, const Mat3 &depthK, const Mat3 *colorK=nullptr, const Mat4 *depthToColorT=nullptr)
 Initialize image recorder. More...
 
bool cleanup ()
 Free image recorder internal data and close output file.
 
void start ()
 Start recording thread. Needs to be called before adding frames.
 
void stop ()
 Stop recording thread. Will return after all images in the queue have been written.
 
bool addFrame (const DepthImage &imgDepth, const ColorImage &imgColor)
 Add frame to file. More...
 

Constructor & Destructor Documentation

◆ RFSRecorder()

RFSRecorder ( const char *  filename)

Create recorder object.

Parameters
filenameFile name of file to record to

Member Function Documentation

◆ init()

bool init ( int  colorWidth,
int  colorHeight,
int  depthWidth,
int  depthHeight,
const Mat3 depthK,
const Mat3 colorK = nullptr,
const Mat4 depthToColorT = nullptr 
)

Initialize image recorder.

Parameters
colorWidthWidth of recorded color images
colorHeightHeight of recorded color images
depthWidthWidth of recorded depth images
depthHeightHeight of recorded depth images
depthKIntrinsic depth camera parameters
colorKIntrinsic color camera parameters (optional)
depthToColorTTransformation from depth to color camera coordinate system (optional)
Returns
True if successful, false otherwise

◆ addFrame()

bool addFrame ( const DepthImage imgDepth,
const ColorImage imgColor 
)

Add frame to file.

The images must have the same size passed to initialize()

Parameters
imgDepth16-bit single channel depth image
imgColor8-bit three channel RGB image
Returns
True when frame was added, false when frame was dropped

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close