TooN
Public Member Functions | Static Public Member Functions | Related Functions | List of all members
TooN::SIM3< Precision > Class Template Reference

Represent a three-dimensional similarity transformation (a rotation, a scale factor and a translation). More...

#include <sim3.h>

Public Member Functions

 SIM3 ()
 Default constructor. Initialises the the rotation to zero (the identity), the scale to one and the translation to zero.
 
template<int S, typename P , typename A >
 SIM3 (const SO3< Precision > &R, const Vector< S, P, A > &T, const Precision &s)
 
template<int S, typename P , typename A >
 SIM3 (const Vector< S, P, A > &v)
 
SO3< Precision > & get_rotation ()
 Returns the rotation part of the transformation as a SO3.
 
const SO3< Precision > & get_rotation () const
 
Vector< 3, Precision > & get_translation ()
 Returns the translation part of the transformation as a Vector.
 
const Vector< 3, Precision > & get_translation () const
 
Precision & get_scale ()
 Returns the scale factor.
 
const Precision & get_scale () const
 
Vector< 7, Precision > ln () const
 
SIM3 inverse () const
 
SIM3operator*= (const SIM3 &rhs)
 Right-multiply by another SIM3 (concatenate the two transformations) More...
 
SIM3operator= (const TooN::Operator< TooN::Internal::Identity< TooN::Internal::One >> &)
 Reset back to the identity transform.
 
template<typename P >
SIM3< typename Internal::MultiplyType< Precision, P >::type > operator* (const SIM3< P > &rhs) const
 Right-multiply by another SIM3 (concatenate the two transformations) More...
 
SIM3left_multiply_by (const SIM3 &left)
 
template<int S, typename P2 , typename Accessor >
Vector< 7, Precision > adjoint (const Vector< S, P2, Accessor > &vect) const
 Transfer a matrix in the Lie Algebra from one co-ordinate frame to another. More...
 
template<int S, typename P2 , typename Accessor >
Vector< 7, Precision > trinvadjoint (const Vector< S, P2, Accessor > &vect) const
 Transfer covectors between frames (using the transpose of the inverse of the adjoint) so that trinvadjoint(vect1) * adjoint(vect2) = vect1 * vect2.
 
template<int R, int C, typename P2 , typename Accessor >
Matrix< 7, 7, Precision > adjoint (const Matrix< R, C, P2, Accessor > &M) const
 
template<int R, int C, typename P2 , typename Accessor >
Matrix< 7, 7, Precision > trinvadjoint (const Matrix< R, C, P2, Accessor > &M) const
 
template<int S, typename P , typename VA >
SIM3< Precision > exp (const Vector< S, P, VA > &mu)
 

Static Public Member Functions

template<int S, typename P , typename A >
static SIM3 exp (const Vector< S, P, A > &vect)
 Exponentiate a Vector in the Lie Algebra to generate a new SIM3. More...
 
static Vector< 7, Precision > ln (const SIM3 &se3)
 Take the logarithm of the matrix, generating the corresponding vector in the Lie Algebra. More...
 
static Matrix< 4, 4, Precision > generator (int i)
 
template<typename Base >
static Vector< 4, Precision > generator_field (int i, const Vector< 4, Precision, Base > &pos)
 Returns the i-th generator times pos.
 

Related Functions

(Note that these are not member functions.)

template<typename Precision >
std::ostream & operator<< (std::ostream &os, const SIM3< Precision > &rhs)
 Write an SIM3 to a stream. More...
 
template<typename Precision >
std::istream & operator>> (std::istream &is, SIM3< Precision > &rhs)
 Reads an SIM3 from a stream. More...
 
template<int S, typename PV , typename A , typename P >
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator* (const SIM3< P > &lhs, const Vector< S, PV, A > &rhs)
 Right-multiply by a Vector. More...
 
template<typename PV , typename A , typename P >
Vector< 3, typename Internal::MultiplyType< P, PV >::type > operator* (const SIM3< P > &lhs, const Vector< 3, PV, A > &rhs)
 Right-multiply by a Vector. More...
 
template<int S, typename PV , typename A , typename P >
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator* (const Vector< S, PV, A > &lhs, const SIM3< P > &rhs)
 Left-multiply by a Vector. More...
 
template<int R, int Cols, typename PM , typename A , typename P >
Matrix< 4, Cols, typename Internal::MultiplyType< P, PM >::type > operator* (const SIM3< P > &lhs, const Matrix< R, Cols, PM, A > &rhs)
 Right-multiply by a Matrix. More...
 
template<int Rows, int C, typename PM , typename A , typename P >
Matrix< Rows, 4, typename Internal::MultiplyType< PM, P >::type > operator* (const Matrix< Rows, C, PM, A > &lhs, const SIM3< P > &rhs)
 Left-multiply by a Matrix. More...
 

Detailed Description

template<typename Precision = DefaultPrecision>
class TooN::SIM3< Precision >

Represent a three-dimensional similarity transformation (a rotation, a scale factor and a translation).

This can be represented by a matrix operating on a homogeneous co-ordinate, so that a vector \(\underline{x}\) is transformed to a new location \(\underline{x}'\) by

\[\begin{aligned}\underline{x}' &= E\times\underline{x}\\ \begin{bmatrix}x'\\y'\\z'\end{bmatrix} &= \begin{pmatrix}s r_{11} & s r_{12} & s r_{13} & t_1\\s r_{21} & s r_{22} & s r_{23} & t_2\\s r_{31} & s r_{32} & s r_{33} & t_3\end{pmatrix}\begin{bmatrix}x\\y\\z\\1\end{bmatrix}\end{aligned}\]

This transformation is a member of the Lie group SIM3. These can be parameterised with seven numbers (in the space of the Lie Algebra). In this class, the first three parameters are a translation vector while the second three are a rotation vector, whose direction is the axis of rotation and length the amount of rotation (in radians), as for SO3. The seventh parameter is the log of the scale of the transformation.

Member Function Documentation

◆ adjoint() [1/2]

template<typename Precision >
template<int S, typename P2 , typename Accessor >
Vector< 7, Precision > TooN::SIM3< Precision >::adjoint ( const Vector< S, P2, Accessor > &  vect) const
inline

Transfer a matrix in the Lie Algebra from one co-ordinate frame to another.

This is the operation such that for a matrix \( B \), \( e^{\text{Adj}(v)} = Be^{v}B^{-1} \)

Parameters
MThe Matrix to transfer

◆ adjoint() [2/2]

template<typename Precision >
template<int R, int C, typename P2 , typename Accessor >
Matrix< 7, 7, Precision > TooN::SIM3< Precision >::adjoint ( const Matrix< R, C, P2, Accessor > &  M) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ exp()

template<typename Precision = DefaultPrecision>
template<int S, typename P , typename A >
static SIM3 TooN::SIM3< Precision >::exp ( const Vector< S, P, A > &  vect)
inlinestatic

Exponentiate a Vector in the Lie Algebra to generate a new SIM3.

See the Detailed Description for details of this vector.

Parameters
vectThe Vector to exponentiate

◆ get_rotation()

template<typename Precision = DefaultPrecision>
const SO3<Precision>& TooN::SIM3< Precision >::get_rotation ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get_scale()

template<typename Precision = DefaultPrecision>
const Precision& TooN::SIM3< Precision >::get_scale ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ get_translation()

template<typename Precision = DefaultPrecision>
const Vector<3, Precision>& TooN::SIM3< Precision >::get_translation ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ ln() [1/2]

template<typename Precision >
Vector< 7, Precision > TooN::SIM3< Precision >::ln ( const SIM3< Precision > &  se3)
inlinestatic

Take the logarithm of the matrix, generating the corresponding vector in the Lie Algebra.

See the Detailed Description for details of this vector.

◆ ln() [2/2]

template<typename Precision = DefaultPrecision>
Vector<7, Precision> TooN::SIM3< Precision >::ln ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator*()

template<typename Precision = DefaultPrecision>
template<typename P >
SIM3<typename Internal::MultiplyType<Precision, P>::type> TooN::SIM3< Precision >::operator* ( const SIM3< P > &  rhs) const
inline

Right-multiply by another SIM3 (concatenate the two transformations)

Parameters
rhsThe multipier

◆ operator*=()

template<typename Precision = DefaultPrecision>
SIM3& TooN::SIM3< Precision >::operator*= ( const SIM3< Precision > &  rhs)
inline

Right-multiply by another SIM3 (concatenate the two transformations)

Parameters
rhsThe multipier

◆ trinvadjoint()

template<typename Precision >
template<int R, int C, typename P2 , typename Accessor >
Matrix< 7, 7, Precision > TooN::SIM3< Precision >::trinvadjoint ( const Matrix< R, C, P2, Accessor > &  M) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Friends And Related Function Documentation

◆ operator*() [1/5]

template<int S, typename PV , typename A , typename P >
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator* ( const SIM3< P > &  lhs,
const Vector< S, PV, A > &  rhs 
)
related

Right-multiply by a Vector.

◆ operator*() [2/5]

template<typename PV , typename A , typename P >
Vector< 3, typename Internal::MultiplyType< P, PV >::type > operator* ( const SIM3< P > &  lhs,
const Vector< 3, PV, A > &  rhs 
)
related

Right-multiply by a Vector.

◆ operator*() [3/5]

template<int S, typename PV , typename A , typename P >
Vector< 4, typename Internal::MultiplyType< P, PV >::type > operator* ( const Vector< S, PV, A > &  lhs,
const SIM3< P > &  rhs 
)
related

Left-multiply by a Vector.

◆ operator*() [4/5]

template<int R, int Cols, typename PM , typename A , typename P >
Matrix< 4, Cols, typename Internal::MultiplyType< P, PM >::type > operator* ( const SIM3< P > &  lhs,
const Matrix< R, Cols, PM, A > &  rhs 
)
related

Right-multiply by a Matrix.

◆ operator*() [5/5]

template<int Rows, int C, typename PM , typename A , typename P >
Matrix< Rows, 4, typename Internal::MultiplyType< PM, P >::type > operator* ( const Matrix< Rows, C, PM, A > &  lhs,
const SIM3< P > &  rhs 
)
related

Left-multiply by a Matrix.

◆ operator<<()

template<typename Precision >
std::ostream & operator<< ( std::ostream &  os,
const SIM3< Precision > &  rhs 
)
related

Write an SIM3 to a stream.

◆ operator>>()

template<typename Precision >
std::istream & operator>> ( std::istream &  is,
SIM3< Precision > &  rhs 
)
related

Reads an SIM3 from a stream.


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