RecFusion SDK
|
#include <RFSRecorder.h>
Saves RGB-D sequences in RFS format. More...
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... | |
RFSRecorder | ( | const char * | filename | ) |
Create recorder object.
filename | File name of file to record to |
bool init | ( | int | colorWidth, |
int | colorHeight, | ||
int | depthWidth, | ||
int | depthHeight, | ||
const Mat3 & | depthK, | ||
const Mat3 * | colorK = nullptr , |
||
const Mat4 * | depthToColorT = nullptr |
||
) |
Initialize image recorder.
colorWidth | Width of recorded color images |
colorHeight | Height of recorded color images |
depthWidth | Width of recorded depth images |
depthHeight | Height of recorded depth images |
depthK | Intrinsic depth camera parameters |
colorK | Intrinsic color camera parameters (optional) |
depthToColorT | Transformation from depth to color camera coordinate system (optional) |
bool addFrame | ( | const DepthImage & | imgDepth, |
const ColorImage & | imgColor | ||
) |
Add frame to file.
The images must have the same size passed to initialize()
imgDepth | 16-bit single channel depth image |
imgColor | 8-bit three channel RGB image |