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

Represent a two-dimensional Similarity transformation (a rotation, a uniform scale and a translation). More...

#include <sim2.h>

Public Member Functions

 SIM2 ()
 Default constructor. Initialises the the rotation to zero (the identity), the scale factor to one and the translation to zero.
 
template<class A >
 SIM2 (const SO2< Precision > &R, const Vector< 2, Precision, A > &T, const Precision s)
 
template<int S, class P , class A >
 SIM2 (const Vector< S, P, A > &v)
 
SO2< Precision > & get_rotation ()
 Returns the rotation part of the transformation as a SO2.
 
const SO2< Precision > & get_rotation () const
 
Vector< 2, Precision > & get_translation ()
 Returns the translation part of the transformation as a Vector.
 
const Vector< 2, Precision > & get_translation () const
 
Precision & get_scale ()
 Returns the scale factor of the transformation.
 
const Precision & get_scale () const
 
Vector< 4, Precision > ln () const
 
SIM2 inverse () const
 compute the inverse of the transformation
 
template<typename P >
SIM2< typename Internal::MultiplyType< Precision, P >::type > operator* (const SIM2< P > &rhs) const
 Right-multiply by another SIM2 (concatenate the two transformations) More...
 
SIM2operator*= (const SIM2 &rhs)
 Self right-multiply by another SIM2 (concatenate the two transformations) More...
 
template<typename Accessor >
Vector< 4, Precision > adjoint (const Vector< 4, Precision, Accessor > &vect) const
 transfers a vector in the Lie algebra, from one coord frame to another so that exp(adjoint(vect)) = (*this) * exp(vect) * (this->inverse())
 
template<typename Accessor >
Matrix< 4, 4, Precision > adjoint (const Matrix< 4, 4, Precision, Accessor > &M) const
 
template<int S, typename PV , typename Accessor >
SIM2< Precision > exp (const Vector< S, PV, Accessor > &mu)
 

Static Public Member Functions

template<int S, typename P , typename A >
static SIM2 exp (const Vector< S, P, A > &vect)
 Exponentiate a Vector in the Lie Algebra to generate a new SIM2. More...
 
static Vector< 4, Precision > ln (const SIM2 &se2)
 Take the logarithm of the matrix, generating the corresponding vector in the Lie Algebra. More...
 
static Matrix< 3, 3, Precision > generator (int i)
 returns the generators for the Lie group. More...
 

Related Functions

(Note that these are not member functions.)

template<class Precision >
std::ostream & operator<< (std::ostream &os, const SIM2< Precision > &rhs)
 Write an SIM2 to a stream. More...
 
template<class Precision >
std::istream & operator>> (std::istream &is, SIM2< Precision > &rhs)
 Read an SIM2 from a stream. More...
 
template<int S, typename P , typename PV , typename A >
Vector< 3, typename Internal::MultiplyType< P, PV >::type > operator* (const SIM2< P > &lhs, const Vector< S, PV, A > &rhs)
 Right-multiply with a Vector<3> More...
 
template<typename P , typename PV , typename A >
Vector< 2, typename Internal::MultiplyType< P, PV >::type > operator* (const SIM2< P > &lhs, const Vector< 2, PV, A > &rhs)
 Right-multiply with a Vector<2> (special case, extended to be a homogeneous vector) More...
 
template<int S, typename P , typename PV , typename A >
Vector< 3, typename Internal::MultiplyType< PV, P >::type > operator* (const Vector< S, PV, A > &lhs, const SIM2< P > &rhs)
 Left-multiply with a Vector<3> More...
 
template<int R, int Cols, typename PM , typename A , typename P >
Matrix< 3, Cols, typename Internal::MultiplyType< P, PM >::type > operator* (const SIM2< P > &lhs, const Matrix< R, Cols, PM, A > &rhs)
 Right-multiply with a Matrix<3> More...
 
template<int Rows, int C, typename PM , typename A , typename P >
Matrix< Rows, 3, typename Internal::MultiplyType< PM, P >::type > operator* (const Matrix< Rows, C, PM, A > &lhs, const SIM2< P > &rhs)
 Left-multiply with a Matrix<3> More...
 

Detailed Description

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

Represent a two-dimensional Similarity transformation (a rotation, a uniform scale and a translation).

This can be represented by a \(2\times 3\) 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'\end{bmatrix} &= \begin{pmatrix}r_{11} & r_{12} & t_1\\r_{21} & r_{22} & t_2\end{pmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}\end{aligned}\]

This transformation is a member of the Lie group SIM2. These can be parameterised with four numbers (in the space of the Lie Algebra). In this class, the first two parameters are a translation vector while the third is the amount of rotation in the plane as for SO2. The forth is the logarithm of the scale factor.

Member Function Documentation

◆ exp()

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

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

See the Detailed Description for details of this vector.

Parameters
vectThe Vector to exponentiate

◆ generator()

template<typename Precision = DefaultPrecision>
static Matrix<3,3, Precision> TooN::SIM2< Precision >::generator ( int  i)
inlinestatic

returns the generators for the Lie group.

These are a set of matrices that form a basis for the vector space of the Lie algebra.

  • 0 is translation in x
  • 1 is translation in y
  • 2 is rotation in the plane
  • 3 is uniform scale

◆ get_rotation()

template<typename Precision = DefaultPrecision>
const SO2<Precision>& TooN::SIM2< 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::SIM2< 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<2, Precision>& TooN::SIM2< 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< 4, Precision > TooN::SIM2< Precision >::ln ( const SIM2< Precision > &  se2)
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<4, Precision> TooN::SIM2< 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 >
SIM2<typename Internal::MultiplyType<Precision,P>::type> TooN::SIM2< Precision >::operator* ( const SIM2< P > &  rhs) const
inline

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

Parameters
rhsThe multipier

◆ operator*=()

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

Self right-multiply by another SIM2 (concatenate the two transformations)

Parameters
rhsThe multipier

Friends And Related Function Documentation

◆ operator*() [1/5]

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

Right-multiply with a Vector<3>

◆ operator*() [2/5]

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

Right-multiply with a Vector<2> (special case, extended to be a homogeneous vector)

◆ operator*() [3/5]

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

Left-multiply with a Vector<3>

◆ operator*() [4/5]

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

Right-multiply with a Matrix<3>

◆ operator*() [5/5]

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

Left-multiply with a Matrix<3>

◆ operator<<()

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

Write an SIM2 to a stream.

◆ operator>>()

template<class Precision >
std::istream & operator>> ( std::istream &  is,
SIM2< Precision > &  rhs 
)
related

Read an SIM2 from a stream.


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