CVR-Lib last update 20 Sep 2009

cvr::euclideanTransformation2D Class Reference
[Geometric Image Transformations]

Class euclideanTransformation2D. More...

#include <cvrEuclideanTransformation2D.h>

Inheritance diagram for cvr::euclideanTransformation2D:

Inheritance graph
[legend]
Collaboration diagram for cvr::euclideanTransformation2D:

Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 The parameters for the class euclideanTransformation2D. More...

Public Member Functions

 euclideanTransformation2D ()
 euclideanTransformation2D (const parameters &par)
 euclideanTransformation2D (const euclideanTransformation2D &other)
virtual ~euclideanTransformation2D ()
template<class P >
bool apply (P &srcdest) const
template<class P >
bool apply (const P &src, P &dest) const
template<class P >
bool estimate (const std::vector< P > &setA, const std::vector< P > &setB)
template<class P >
bool estimateLLS (const std::vector< P > &setA, const std::vector< P > &setB)
template<class P >
bool estimateLLS (const ivector &selection, const std::vector< P > &setA, const std::vector< P > &setB)
int dof () const
void generateMatrix (fmatrix &mat) const
fmatrix generateMatrix () const
euclideanTransformation2Dcopy (const euclideanTransformation2D &other)
euclideanTransformation2Doperator= (const euclideanTransformation2D &other)
virtual const std::string & name () const
virtual euclideanTransformation2Dclone () const
virtual euclideanTransformation2DnewInstance () const
const parametersgetParameters () const
bool updateParameters ()

Protected Member Functions

parametersgetRWParameters ()

Protected Attributes

float cosa_
float sina_
fpoint trans_
linearLeastSquares lls_


Detailed Description

Class euclideanTransformation2D.

The euclidean transformation (also called isometric transformation) for 2D spaces performs a planar modification of points in which only rotation and translation are applied.

This class transforms points only, and therefore is not intended for images, in which case you should use cvr::matrixTransform. You can however obtain from this class the matrix used by cvr::matrixTransform::parameters to generate the same results.

Most apply methods are templates of a point type P, i.e. the type P is usually a container that can be accessed with the operator[], like the types cvr::point<T>, cvr::vector<T>.

See also:
euclideanTransformation2D::parameters.

euclideanTransformation3D

similarityTransformation2D

affineTransformation2D

projectiveTransformation2D


Constructor & Destructor Documentation

cvr::euclideanTransformation2D::euclideanTransformation2D (  ) 

Default constructor.

cvr::euclideanTransformation2D::euclideanTransformation2D ( const parameters par  ) 

Construct a functor using the given parameters.

cvr::euclideanTransformation2D::euclideanTransformation2D ( const euclideanTransformation2D other  ) 

Copy constructor.

Parameters:
other the object to be copied

virtual cvr::euclideanTransformation2D::~euclideanTransformation2D (  )  [virtual]

Destructor.


Member Function Documentation

template<class P >
bool cvr::euclideanTransformation2D::apply ( const P &  src,
P &  dest 
) const [inline]

Transform the point src and write the transformation on the dest point.

Parameters:
src point<T> with the source data.
dest point<T> where the result will be left.
Returns:
true if apply successful or false otherwise.

template<class P >
bool cvr::euclideanTransformation2D::apply ( P &  srcdest  )  const [inline]

Transform the given point.

Parameters:
srcdest point<T> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

virtual euclideanTransformation2D* cvr::euclideanTransformation2D::clone (  )  const [virtual]

Returns a pointer to a clone of this functor.

Implements cvr::functor.

euclideanTransformation2D& cvr::euclideanTransformation2D::copy ( const euclideanTransformation2D other  ) 

Copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

int cvr::euclideanTransformation2D::dof (  )  const

Degrees of freedom of the transformation.

Usually this means the minimal number of parameters with which the transforamtion matrix can be generated.

template<class P >
bool cvr::euclideanTransformation2D::estimate ( const std::vector< P > &  setA,
const std::vector< P > &  setB 
) [inline]

Estimate a transformation that maps the first set of points into the second set of points.

The resulting estimation is left in the parameters.

This method assumes that the corresponding point to setA[idx] is stored in setB[idx].

Only the first dof()/2 correspondences will be used for the estimation, and you need at least dof()/2 elements for the transformation to be computed.

template<class P >
bool cvr::euclideanTransformation2D::estimateLLS ( const ivector selection,
const std::vector< P > &  setA,
const std::vector< P > &  setB 
) [inline]

Do a linear least squares error minimization for a transformation that maps the first set of points into the second set of points.

The resulting estimation is left in the parameters.

This method assumes that the corresponding point to setA[idx] is stored in setB[idx].

For the LLS to be computed, more than dof()/2 correspondences are necessary for the estimation.

For the estimation, just the points with the indices specified in selection are given.

Returns:
true if successful, false otherwise

template<class P >
bool cvr::euclideanTransformation2D::estimateLLS ( const std::vector< P > &  setA,
const std::vector< P > &  setB 
) [inline]

Do a linear least squares error minimization for a transformation that maps the first set of points into the second set of points.

The resulting estimation is left in the parameters.

This method assumes that the corresponding point to setA[idx] is stored in setB[idx].

For the LLS to be computed, more than dof()/2 correspondences are necessary for the estimation.

fmatrix cvr::euclideanTransformation2D::generateMatrix (  )  const

Generate the transformation matrix that would be required by cvr::matrixTransform to generate the same coordinate transformation.

The result is, so to speak, the matrix representation of the parameters.

void cvr::euclideanTransformation2D::generateMatrix ( fmatrix mat  )  const

Generate the transformation matrix that would be required by cvr::matrixTransform to generate the same coordinate transformation.

The result is, so to speak, the matrix representation of the parameters.

Parameters:
mat matrix container of the result.

const parameters& cvr::euclideanTransformation2D::getParameters (  )  const

Returns used parameters.

Reimplemented from cvr::parametersManager.

parameters& cvr::euclideanTransformation2D::getRWParameters (  )  [protected]

Returns used parameters.

virtual const std::string& cvr::euclideanTransformation2D::name (  )  const [virtual]

Returns the complete name of the functor class.

Implements cvr::functor.

virtual euclideanTransformation2D* cvr::euclideanTransformation2D::newInstance (  )  const [virtual]

Returns a pointer to a new instance of this functor.

Implements cvr::functor.

euclideanTransformation2D& cvr::euclideanTransformation2D::operator= ( const euclideanTransformation2D other  ) 

Alias for copy member.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

bool cvr::euclideanTransformation2D::updateParameters (  )  [virtual]

Update parameters.

Reimplemented from cvr::parametersManager.


Member Data Documentation

Cosine of the rotation angle.

Singular value decomposition.

Convenience method to avoid the SVD to be present in the template implementation

Sine of the rotation angle.

Shadow of the translation point.


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

Generated on Sun Sep 20 22:08:57 2009 for CVR-Lib by Doxygen 1.5.8