Image Component Library (ICL)
Public Types | Static Public Member Functions | Private Member Functions | List of all members
icl::geom::PoseEstimator Class Reference

Utility class for 6D PoseEstimation. More...

#include <PoseEstimator.h>

Public Types

enum  MapMode { Translation, RigidBody, Similarity, Affine }
 The MapMode determines, how the point-to-point transformation is computed. More...
 

Static Public Member Functions

template<class T >
static ICLGeom_API math::FixedMatrix< T, 4, 4 > map (const math::DynMatrix< T > &Xs, const math::DynMatrix< T > &Ys, MapMode mode=RigidBody)
 main mapping function, that is called by all other convenience wrappers (instantiated for T=icl32f and T=icl64f) More...
 
template<class T , unsigned int NUM_POINTS>
static math::FixedMatrix< T, 4, 4 > map (const math::FixedMatrix< T, NUM_POINTS, 3 > &Xs, const math::FixedMatrix< T, NUM_POINTS, 3 > &Ys, MapMode mode=RigidBody)
 Convenienc template that uses FixedMatrix inputs (available for T=icl32f and T=icl64f) More...
 
template<class T , unsigned int NUM_POINTS>
static math::FixedMatrix< T, 4, 4 > map (const math::FixedMatrix< T, NUM_POINTS, 4 > &Xs, const math::FixedMatrix< T, NUM_POINTS, 4 > &Ys, MapMode mode=RigidBody)
 Convenienc template that uses FixedMatrix inputs (available for T=icl32f and T=icl64f) More...
 
static Mat map (const std::vector< Vec > &Xs, const std::vector< Vec > &Ys, MapMode mode=RigidBody)
 Convenience function that passes std::vector<Vec> data as DynMatrix<T> to other map function. More...
 
template<class T >
static ICLGeom_API math::FixedMatrix< T, 3, 3 > quaternion_to_rotation_matrix (T w, T x, T y, T z)
 utility function (instantiated for depth32f and depth64f) More...
 

Private Member Functions

 PoseEstimator ()
 Private constructor -> no instances of PoseEstimator possible. More...
 

Detailed Description

Utility class for 6D PoseEstimation.

Given N points in one coordinate frame and corresponding points in another coordinate frame, the relative transformation between these two frames can be computed (the points must not be collinear). The PoseEstimator class provides functions to compute the relative mapping between coordinate frames. Given a set of points in frame A (called Xs, each point is one column of the matrix Xs), and a set of the same size of points in frame B (called Ys, each point is one column of the matrix Ys, the map function will return the homogeneous 4x4-transform matrix that transforms points givne w.r.t. frame A into points in frame B. If MapMode is 'Affine' map needs at least 4 points to solve the problem.

Internally, a MapMode variable is used to determine the algorithm to compute the mapping.

The internal implementation is based on an implementation found in VTK 5.6.0, that was also re-implemented with libeigen2 from Robert Haschke.

Member Enumeration Documentation

◆ MapMode

The MapMode determines, how the point-to-point transformation is computed.

Enumerator
Translation 

returns a transformation for the mean translation between the point-sets

RigidBody 

most common RigidBody mapping (using eigenvector analysis and quaternion representation)

Similarity 

as RigidBody, but with additional scaling

Affine 

affine mapping: (XX^-1 * XY)^T (here, at least 4 points are needed)

Constructor & Destructor Documentation

◆ PoseEstimator()

icl::geom::PoseEstimator::PoseEstimator ( )
inlineprivate

Private constructor -> no instances of PoseEstimator possible.

Member Function Documentation

◆ map() [1/4]

template<class T >
static ICLGeom_API math::FixedMatrix<T,4,4> icl::geom::PoseEstimator::map ( const math::DynMatrix< T > &  Xs,
const math::DynMatrix< T > &  Ys,
MapMode  mode = RigidBody 
)
static

main mapping function, that is called by all other convenience wrappers (instantiated for T=icl32f and T=icl64f)

Xs and Ys must

  • have same column-count
  • same row-count
  • row-cout 3 or 4 (if it is 4, the last row is not used at all)
  • at least one column (however you'll need 3 columns for 6D mapping

◆ map() [2/4]

template<class T , unsigned int NUM_POINTS>
static math::FixedMatrix<T,4,4> icl::geom::PoseEstimator::map ( const math::FixedMatrix< T, NUM_POINTS, 3 > &  Xs,
const math::FixedMatrix< T, NUM_POINTS, 3 > &  Ys,
MapMode  mode = RigidBody 
)
inlinestatic

Convenienc template that uses FixedMatrix inputs (available for T=icl32f and T=icl64f)

The inputs's data points are passes to the main map-function using a shallow DynMatrix<T> wrappter

◆ map() [3/4]

template<class T , unsigned int NUM_POINTS>
static math::FixedMatrix<T,4,4> icl::geom::PoseEstimator::map ( const math::FixedMatrix< T, NUM_POINTS, 4 > &  Xs,
const math::FixedMatrix< T, NUM_POINTS, 4 > &  Ys,
MapMode  mode = RigidBody 
)
inlinestatic

Convenienc template that uses FixedMatrix inputs (available for T=icl32f and T=icl64f)

The inputs's data points are passes to the main map-function using a shallow DynMatrix<T> wrappter

◆ map() [4/4]

static Mat icl::geom::PoseEstimator::map ( const std::vector< Vec > &  Xs,
const std::vector< Vec > &  Ys,
MapMode  mode = RigidBody 
)
inlinestatic

Convenience function that passes std::vector<Vec> data as DynMatrix<T> to other map function.

◆ quaternion_to_rotation_matrix()

template<class T >
static ICLGeom_API math::FixedMatrix<T,3,3> icl::geom::PoseEstimator::quaternion_to_rotation_matrix ( w,
x,
y,
z 
)
static

utility function (instantiated for depth32f and depth64f)


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