RecFusion SDK
Calibration Class Reference

#include <Calibration.h>

Provides functions for calibrating multi-sensor setups. 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.

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, const Mat4 *depthToColorT=0)
 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...
 

Static Public Member Functions

static bool getMarkerPose (int markerId, double markerSize, const ColorImage &imgColor, const Mat3 &colorK, Mat4 &T)
 Get transformation from specified marker to sensor. More...
 

Member Function Documentation

◆ init()

bool 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.

◆ setMarker()

void 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.

◆ setImage()

bool setImage ( int  sensor,
const DepthImage imgDepth,
const ColorImage imgColor,
const Mat3 depthK,
const Mat3 colorK,
const Mat4 depthToColorT = 0 
)

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)
depthToColorTTransformation from depth to color
Returns
False if invalid sensor index was provide, true otherwise

If the image has been previously set it is overwritten

◆ calibrate()

bool 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 setMarker and setImage

◆ getTransformation()

bool 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

◆ getMarkerPose()

static bool getMarkerPose ( int  markerId,
double  markerSize,
const ColorImage imgColor,
const Mat3 colorK,
Mat4 T 
)
static

Get transformation from specified marker to sensor.

Parameters
markerIdID of the marker
markerSizeSide length of the marker in mm
imgColorColor image from sensor showing calibration target
colorKIntrinsics of color sensor (typically identical to depth intrinsics)
TTransformation from marker coordinate system to sensor
Returns
True if transformation is available, false otherwise

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