last update 20 Sep 2009 |
#include <cvrEuclideanTransformation2D.h>
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 |
euclideanTransformation2D & | copy (const euclideanTransformation2D &other) |
euclideanTransformation2D & | operator= (const euclideanTransformation2D &other) |
virtual const std::string & | name () const |
virtual euclideanTransformation2D * | clone () const |
virtual euclideanTransformation2D * | newInstance () const |
const parameters & | getParameters () const |
bool | updateParameters () |
Protected Member Functions | |
parameters & | getRWParameters () |
Protected Attributes | |
float | cosa_ |
float | sina_ |
fpoint | trans_ |
linearLeastSquares | lls_ |
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>.
euclideanTransformation3D
projectiveTransformation2D
cvr::euclideanTransformation2D::euclideanTransformation2D | ( | ) |
Default constructor.
cvr::euclideanTransformation2D::euclideanTransformation2D | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
cvr::euclideanTransformation2D::euclideanTransformation2D | ( | const euclideanTransformation2D & | other | ) |
virtual cvr::euclideanTransformation2D::~euclideanTransformation2D | ( | ) | [virtual] |
Destructor.
bool cvr::euclideanTransformation2D::apply | ( | const P & | src, | |
P & | dest | |||
) | const [inline] |
bool cvr::euclideanTransformation2D::apply | ( | P & | srcdest | ) | const [inline] |
Transform the given point.
srcdest | point<T> with the source data. The result will be left here too. |
virtual euclideanTransformation2D* cvr::euclideanTransformation2D::clone | ( | ) | const [virtual] |
euclideanTransformation2D& cvr::euclideanTransformation2D::copy | ( | const euclideanTransformation2D & | other | ) |
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.
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.
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.
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.
const parameters& cvr::euclideanTransformation2D::getParameters | ( | ) | const |
parameters& cvr::euclideanTransformation2D::getRWParameters | ( | ) | [protected] |
Returns used parameters.
virtual const std::string& cvr::euclideanTransformation2D::name | ( | ) | const [virtual] |
virtual euclideanTransformation2D* cvr::euclideanTransformation2D::newInstance | ( | ) | const [virtual] |
euclideanTransformation2D& cvr::euclideanTransformation2D::operator= | ( | const euclideanTransformation2D & | other | ) |
bool cvr::euclideanTransformation2D::updateParameters | ( | ) | [virtual] |
float cvr::euclideanTransformation2D::cosa_ [protected] |
Cosine of the rotation angle.
Singular value decomposition.
Convenience method to avoid the SVD to be present in the template implementation
float cvr::euclideanTransformation2D::sina_ [protected] |
Sine of the rotation angle.
fpoint cvr::euclideanTransformation2D::trans_ [protected] |
Shadow of the translation point.