Ocean
Ocean::Geometry::AbsoluteTransformation Class Reference

This class provides functions determining the absolute transformation between two point sets. More...

Public Types

enum class  ScaleErrorType { RightBiased , LeftBiased , Symmetric }
 Defines whether the error term for the scale calculation is in the space of right coordinate system, the left coordinate system, or uses a symmetric formulation. More...
 

Static Public Member Functions

static bool calculateTransformation (const Vector3 *left, const Vector3 *right, const size_t correspondences, HomogenousMatrix4 &right_T_left, const ScaleErrorType scaleErrorType=ScaleErrorType::RightBiased, Scalar *scale=nullptr)
 Calculates the absolute transformation between two corresponding 3D point sets. More...
 
static bool calculateTransformation (const HomogenousMatrix4 *leftWorld_T_transformations, const HomogenousMatrix4 *rightWorld_T_transformations, const size_t correspondences, HomogenousMatrix4 &rightWorld_T_leftWorld, const ScaleErrorType scaleErrorType=ScaleErrorType::RightBiased, Scalar *scale=nullptr)
 Calculates the absolute transformation between two sets of 6-DOF transformations not containing outliers. More...
 
static bool calculateTransformationWithOutliers (const HomogenousMatrix4 *leftWorld_T_transformations, const HomogenousMatrix4 *rightWorld_T_transformations, const size_t correspondences, HomogenousMatrix4 &rightWorld_T_leftWorld, const Scalar inlierRate=Scalar(0.75), const ScaleErrorType scaleErrorType=ScaleErrorType::RightBiased, Scalar *scale=nullptr)
 Calculates the absolute transformation between two sets of 6-DOF transformations which may contain outliers. More...
 

Static Protected Member Functions

static bool removeOutliers (const HomogenousMatrix4 *leftWorld_T_transformations, const HomogenousMatrix4 *rightWorld_T_transformations, const size_t correspondences, const HomogenousMatrix4 &rightWorld_T_leftWorld, HomogenousMatrices4 &leftWorld_T_subsetTransformations, HomogenousMatrices4 &rightWorld_T_subsetTransformations)
 Removes the outliers from the set of 6-DOF input transformations. More...
 

Detailed Description

This class provides functions determining the absolute transformation between two point sets.

Member Enumeration Documentation

◆ ScaleErrorType

Defines whether the error term for the scale calculation is in the space of right coordinate system, the left coordinate system, or uses a symmetric formulation.

Enumerator
RightBiased 

Error term for scaling computation is in the units of the right coordinate system (e = || Pright - s * R * Pleft ||^2).

LeftBiased 

Error term for scaling computation is in the units of the left coordinate system (e = || (1 / s) * (R^{-1}) * Pright - Pleft ||^2).

Symmetric 

Error term for scaling computation uses a symmetric formulation (e = || (1 / sqrt(s)) * Pright - sqrt(s) * R * Pleft) ||^2 ). (Recommended by Horn in the general case.)

Member Function Documentation

◆ calculateTransformation() [1/2]

static bool Ocean::Geometry::AbsoluteTransformation::calculateTransformation ( const HomogenousMatrix4 leftWorld_T_transformations,
const HomogenousMatrix4 rightWorld_T_transformations,
const size_t  correspondences,
HomogenousMatrix4 rightWorld_T_leftWorld,
const ScaleErrorType  scaleErrorType = ScaleErrorType::RightBiased,
Scalar scale = nullptr 
)
static

Calculates the absolute transformation between two sets of 6-DOF transformations not containing outliers.

The implementation follows "Comparing two sets of corresponding six degree of freedom data, Shah, 2011"
Beware: This function does not support outliers.

Parameters
leftWorld_T_transformationsThe individual transformations defined in the left world, must be valid
rightWorld_T_transformationsThe idividual transformations defines in the right world, one for each transformation in the left world, must be valid
correspondencesThe number of given transformation correspondences, with range [1, infinity)
rightWorld_T_leftWorldThe resulting transformation between the left world and the right world
scaleErrorTypeThe error type to use for the scale computation
scaleIf non-null, will be populated with the resulting scale. The caller may want to update the transformation as follows: rightWorld_T_leftWorld.applyScale(Vector3(*scale, *scale, *scale))
Returns
True, if succeeded

◆ calculateTransformation() [2/2]

static bool Ocean::Geometry::AbsoluteTransformation::calculateTransformation ( const Vector3 left,
const Vector3 right,
const size_t  correspondences,
HomogenousMatrix4 right_T_left,
const ScaleErrorType  scaleErrorType = ScaleErrorType::RightBiased,
Scalar scale = nullptr 
)
static

Calculates the absolute transformation between two corresponding 3D point sets.

The implementation follows "Closed-form solution of absolute orientation using unit quaternions, Horn, 1986"
The resulting transformation contains translation and rotation, but no scaling. The scale term can be retrieved optionally – this allows the transformation to be inverted more reliably.
Beware: This function does not support outliers.

Parameters
leftThe object points defined in the 'left' coordinate system, must be valid
rightThe object points define in the 'right' coordinate system, one for each object point in the 'left' coordinate system, must be valid
correspondencesNumber of point correspondences, with range [3, infinity)
right_T_leftResulting transformation between left and right points, with no scaling.
scaleErrorTypeThe error type to use for the scale computation
scaleIf non-null, will be populated with the resulting scale. The caller may want to update the transformation as follows: right_T_left.applyScale(Vector3(*scale, *scale, *scale))
Returns
True, if succeeded

◆ calculateTransformationWithOutliers()

static bool Ocean::Geometry::AbsoluteTransformation::calculateTransformationWithOutliers ( const HomogenousMatrix4 leftWorld_T_transformations,
const HomogenousMatrix4 rightWorld_T_transformations,
const size_t  correspondences,
HomogenousMatrix4 rightWorld_T_leftWorld,
const Scalar  inlierRate = Scalar(0.75),
const ScaleErrorType  scaleErrorType = ScaleErrorType::RightBiased,
Scalar scale = nullptr 
)
static

Calculates the absolute transformation between two sets of 6-DOF transformations which may contain outliers.

The implementation follows "Comparing two sets of corresponding six degree of freedom data, Shah, 2011"

Parameters
leftWorld_T_transformationsThe individual transformations defined in the left world, must be valid
rightWorld_T_transformationsThe idividual transformations defines in the right world, one for each transformation in the left world, must be valid
correspondencesthe number of given transformation correspondences, with range [1, infinity)
rightWorld_T_leftWorldThe resulting transformation between the left world and the right world
inlierRateThe rate of inlier in the given input data with range (0, 1)
scaleErrorTypeThe error type to use for the scale computation
scaleIf non-null, will be populated with the resulting scale. The caller may want to update the transformation as follows: rightWorld_T_leftWorld.applyScale(Vector3(*scale, *scale, *scale))
Returns
True, if succeeded

◆ removeOutliers()

static bool Ocean::Geometry::AbsoluteTransformation::removeOutliers ( const HomogenousMatrix4 leftWorld_T_transformations,
const HomogenousMatrix4 rightWorld_T_transformations,
const size_t  correspondences,
const HomogenousMatrix4 rightWorld_T_leftWorld,
HomogenousMatrices4 leftWorld_T_subsetTransformations,
HomogenousMatrices4 rightWorld_T_subsetTransformations 
)
staticprotected

Removes the outliers from the set of 6-DOF input transformations.

Parameters
leftWorld_T_transformationsThe individual transformations defined in the left world, must be valid
rightWorld_T_transformationsThe idividual transformations defines in the right world, one for each transformation in the left world, must be valid
correspondencesthe number of given transformation correspondences, with range [1, infinity)
rightWorld_T_leftWorldThe transformation between the left world and the right world
leftWorld_T_subsetTransformationsThe resulting inlier transformations for 'leftWorld_T_transformations'
rightWorld_T_subsetTransformationsThe resulting inlier transformations for 'rightWorld_T_transformations'
Returns
True, if the input data contained some outliers; False, if the input data did not contain any outliers

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