RecFusion SDK
 All Classes Functions Variables Enumerations Enumerator
RecFusion::Calibration Class Reference

Provides functions for calibrating multi-sensor setups. More...

Public Member Functions

 Calibration ()
 Create calibration object.
 
 ~Calibration ()
 Destroy calibration object.
 
bool init (int sensors)
 Set up calibration. More...
 
void setMarker (int markerId, double markerSize, const Mat4 *markerT=0)
 Define marker with given ID. More...
 
bool setImage (int sensor, const DepthImage &imgDepth, const ColorImage &imgColor, const Mat3 &depthK, const Mat3 &colorK)
 Set image for given sensor. More...
 
bool calibrate ()
 Perform calibration using the previously set markers and images. More...
 
bool getTransformation (int sensor, Mat4 &T)
 Get transformation from specified sensor to first sensor. More...
 

Detailed Description

Provides functions for calibrating multi-sensor setups.

To calibrate a multi-sensor setup a calibration marker needs to be placed in such a way that it is visible in all sensors which are to be calibrated. For each sensor a color image needs to be acquired. The calibration object needs to be initialized with the number of sensors to calibrate by calling the init method. Next the markers used for calibration have to be specified using setMarker. It is possible to specify more than one marker. In this case the transformation from each marker coordinate system to a common calibration coordinate system needs to be provided. Next the calibration images need to be set using setImage. At this point calibrate can be called to calibrate the sensor locations. The results can be retrieved using getTransformation. The returned transformation provides the transformation from the specified sensor coordinate system to the coordinate system of the first sensor. It is represented as homogeneous 4x4 matrix with the upper left 3x3 matrix representig the rotation component and the upper right 3x1 vector representing the translation component. The matrix can be passed directly to the sensorT parameter of Reconstruction::addFrame method.

Member Function Documentation

bool RecFusion::Calibration::calibrate ( )

Perform calibration using the previously set markers and images.

Returns
True if the marker was detected in all images and calibration succeeded, false otherwise
        Before calling this method the marker(s) and the images have to be specified using \ref setMarker and \ref setImage
bool RecFusion::Calibration::getTransformation ( int  sensor,
Mat4 T 
)

Get transformation from specified sensor to first sensor.

Parameters
sensorSensor index for which to retrieve transformation
TTransformation from specified to first sensor
Returns
True if transformation is available, false otherwise
bool RecFusion::Calibration::init ( int  sensors)

Set up calibration.

Parameters
sensorsNubmer of sensors to calibrate
Returns
True if successful, false otherwise

Needs to be called before any other functions can be called. Clears previously set markers and images.

bool RecFusion::Calibration::setImage ( int  sensor,
const DepthImage imgDepth,
const ColorImage imgColor,
const Mat3 depthK,
const Mat3 colorK 
)

Set image for given sensor.

Parameters
sensorSensor index
imgDepthDepth image from sensor corresponding to color image showing calibration target
imgColorColor image from sensor showing calibration target
depthKIntrinsics of depth sensor
colorKIntrinsics of color sensor (typically identical to depth intrinsics)
Returns
False if invalid sensor index was provide, true otherwise

If the image has been previously set it is overwritten

void RecFusion::Calibration::setMarker ( int  markerId,
double  markerSize,
const Mat4 markerT = 0 
)

Define marker with given ID.

Parameters
markerIdID of the marker
markerSizeSide length of the marker in mm
markerTOptional transformation from the marker coordinate system to the calibration object coordinate system.
Returns
False if invalid sensor index was provided, true otherwise

Overwrittes previously defined markers with the same ID.


The documentation for this class was generated from the following file: