### Topics

 RobWorkProject
PerspectiveTransform2D< T > Class Template Reference

The PerspectiveTransform2D is a perspective transform in 2D. More...

#include <PerspectiveTransform2D.hpp>

## Public Member Functions

PerspectiveTransform2D ()
constructor

PerspectiveTransform2D (T r11, T r12, T r13, T r21, T r22, T r23, T r31, T r32, T r33)
constructor

template<class R >
PerspectiveTransform2D (const boost::numeric::ublas::matrix_expression< R > &r)
constructor More...

template<class R >
PerspectiveTransform2D (const Eigen::Matrix< R, 3, 3 > &r)
constructor More...

template<class R >
PerspectiveTransform2D (const Eigen::MatrixBase< R > &r)
constructor More...

PerspectiveTransform2D< T > inverse ()
Returns the inverse of the PerspectiveTransform.

T & operator() (std::size_t row, std::size_t col)
Returns matrix element reference. More...

const T & operator() (std::size_t row, std::size_t col) const
Returns const matrix element reference. More...

Vector3D< T > calc3dVec (const PerspectiveTransform2D< T > &hT, const Vector2D< T > &v)
transform a 2d point into a 3d point with this perspective transform More...

BoostMatrix3x3 m ()
Returns Boost matrix representing the 3x3 matrix that represents this rotation. More...

const EigenMatrix3x3 & e () const
Returns reference to the 3x3 matrix that represents this rotation. More...

EigenMatrix3x3 & e ()
Returns reference to the 3x3 matrix that represents this rotation. More...

## Static Public Member Functions

static PerspectiveTransform2D< T > calcTransform (std::vector< Vector2D< T > > pts1, std::vector< Vector2D< T > > pts2)
calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2 More...

## Friends

Vector2D< T > operator* (const PerspectiveTransform2D< T > &hT, const Vector2D< T > &v)
transform a point using this perspective transform

## Related Functions

(Note that these are not member functions.)

template<class T >
PerspectiveTransform2D< T > inverse (const PerspectiveTransform2D< T > &aRb)
Take the inverse of a PerspectiveTransform2D. More...

template<>
void write (const rw::math::PerspectiveTransform2D< double > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)

template<>
void write (const rw::math::PerspectiveTransform2D< float > &sobject, rw::common::OutputArchive &oarchive, const std::string &id)

template<>
void read (rw::math::PerspectiveTransform2D< double > &sobject, rw::common::InputArchive &iarchive, const std::string &id)

template<>
void read (rw::math::PerspectiveTransform2D< float > &sobject, rw::common::InputArchive &iarchive, const std::string &id)

## Detailed Description

### template<class T = double> class rw::math::PerspectiveTransform2D< T >

The PerspectiveTransform2D is a perspective transform in 2D.

The homographic transform can be used to map one arbitrary 2D quadrilateral into another.

## Constructor & Destructor Documentation

 PerspectiveTransform2D ( const boost::numeric::ublas::matrix_expression< R > & r )
inlineexplicit

constructor

Parameters
 r
Returns
 PerspectiveTransform2D ( const Eigen::Matrix< R, 3, 3 > & r )
inlineexplicit

constructor

Parameters
 r
Returns
 PerspectiveTransform2D ( const Eigen::MatrixBase< R > & r )
inlineexplicit

constructor

Parameters
 r
Returns

## Member Function Documentation

 Vector3D calc3dVec ( const PerspectiveTransform2D< T > & hT, const Vector2D< T > & v )
inline

transform a 2d point into a 3d point with this perspective transform

Parameters
 hT v
Returns
 static PerspectiveTransform2D calcTransform ( std::vector< Vector2D< T > > pts1, std::vector< Vector2D< T > > pts2 )
static

calculates a PerspectiveTransform2D that maps points from point set pts1 to point set pts2

Parameters
 pts1 [in] point set one pts2 [in] point set two
 const EigenMatrix3x3& e ( ) const
inline

Returns reference to the 3x3 matrix that represents this rotation.

Returns
 EigenMatrix3x3& e ( )
inline

Returns reference to the 3x3 matrix that represents this rotation.

Returns
 BoostMatrix3x3 m ( )
inline

Returns Boost matrix representing the 3x3 matrix that represents this rotation.

Returns
 T& operator() ( std::size_t row, std::size_t col )
inline

Returns matrix element reference.

Parameters
 row [in] row, row must be col [in] col, col must be
Returns
reference to matrix element
 const T& operator() ( std::size_t row, std::size_t col ) const
inline

Returns const matrix element reference.

Parameters
 row [in] row, row must be col [in] col, col must be
Returns
const reference to matrix element

## Friends And Related Function Documentation

 PerspectiveTransform2D< T > inverse ( const PerspectiveTransform2D< T > & aRb )
related

Take the inverse of a PerspectiveTransform2D.

Parameters
 aRb [in] a PerspectiveTransform2D.
Returns
the inverse of aRb .
 void read ( rw::math::PerspectiveTransform2D< double > & sobject, rw::common::InputArchive & iarchive, const std::string & id )
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
 sobject [out] the object in which the data should be streamed into iarchive [in] the InputArchive from which to read data. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.
 void read ( rw::math::PerspectiveTransform2D< float > & sobject, rw::common::InputArchive & iarchive, const std::string & id )
related

Enable read-serialization of class T by overloading this method. Data is read from iarchive and filled into sobject.

Parameters
 sobject [out] the object in which the data should be streamed into iarchive [in] the InputArchive from which to read data. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.
 void write ( const rw::math::PerspectiveTransform2D< double > & sobject, rw::common::OutputArchive & oarchive, const std::string & id )
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
 sobject [in] the object from which the data should be streamed. oarchive [out] the OutputArchive in which data should be written. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.
 void write ( const rw::math::PerspectiveTransform2D< float > & sobject, rw::common::OutputArchive & oarchive, const std::string & id )
related

Enable write-serialization of class T by overloading this method. Data is written to oarchive from the sobject.

Parameters
 sobject [in] the object from which the data should be streamed. oarchive [out] the OutputArchive in which data should be written. id [in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

The documentation for this class was generated from the following file:
• PerspectiveTransform2D.hpp