RobWorkProject  24.8.23-
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 Eigen::Matrix< R, 3, 3 > &r)
constructor More...

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

PerspectiveTransform2D< T > inverse () const
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...

rw::math::Vector2D< T > operator* (const rw::math::Vector2D< T > &v) const
transform a point using this perspective transform

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

const Eigen::Matrix< T, 3, 3 > & e () const
Returns reference to the 3x3 matrix $$\mathbf{M}\in SO(3)$$ that represents this rotation. More...

Eigen::Matrix< T, 3, 3 > & e ()
Returns reference to the 3x3 matrix $$\mathbf{M}\in SO(3)$$ that represents this rotation. More...

## Static Public Member Functions

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

## 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.

## ◆ PerspectiveTransform2D() [1/2]

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

constructor

Parameters
 r
Returns

## ◆ PerspectiveTransform2D() [2/2]

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

constructor

Parameters
 r
Returns

## ◆ calc3dVec()

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

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

Parameters
 hT v
Returns

## ◆ calcTransform()

 static PerspectiveTransform2D calcTransform ( std::vector< rw::math::Vector2D< T >> pts1, std::vector< rw::math::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

## ◆ e() [1/2]

 Eigen::Matrix& e ( )
inline

Returns reference to the 3x3 matrix $$\mathbf{M}\in SO(3)$$ that represents this rotation.

Returns
$$\mathbf{M}\in SO(3)$$

## ◆ e() [2/2]

 const Eigen::Matrix& e ( ) const
inline

Returns reference to the 3x3 matrix $$\mathbf{M}\in SO(3)$$ that represents this rotation.

Returns
$$\mathbf{M}\in SO(3)$$

## ◆ operator()() [1/2]

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

Returns matrix element reference.

Parameters
 row [in] row, row must be $$< 3$$ col [in] col, col must be $$< 3$$
Returns
reference to matrix element

## ◆ operator()() [2/2]

 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 $$< 3$$ col [in] col, col must be $$< 3$$
Returns
const reference to matrix element

## ◆ inverse()

 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

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

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.

## ◆ write() [1/2]

 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.

## ◆ write() [2/2]

 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 files:
• core/math_fwd.hpp
• PerspectiveTransform2D.hpp