latest version v1.9 - last update 10 Apr 2010 |
This class estimates a translation and common scale for the x and y coordinates, i.e. More...
#include <ltiTranslationScaleEstimator.h>
Classes | |
class | parameters |
The parameters for the class translationScaleEstimator. More... | |
Public Member Functions | |
translationScaleEstimator () | |
translationScaleEstimator (const parameters &par) | |
translationScaleEstimator (const translationScaleEstimator &other) | |
virtual | ~translationScaleEstimator () |
virtual const char * | getTypeName () const |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest) const |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, fvector &error) const |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, const ivector &indices, int numCorrespondences) const |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, fvector &error, const ivector &indices, int numCorrespondences) const |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest) const |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, fvector &error) const |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, const ivector &indices, int numCorrespondences) const |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, fvector &error, const ivector &indices, int numCorrespondences) const |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest) const |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, dvector &error) const |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, const ivector &indices, int numCorrespondences) const |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, dvector &error, const ivector &indices, int numCorrespondences) const |
virtual bool | computeResidual (const matrix< fpoint > &src, const fvector &transform, fvector &dest) const |
virtual bool | computeResidual (const matrix< dpoint > &src, const dvector &transform, dvector &dest) const |
virtual int | minNumberCorrespondences () const |
virtual int | minCorrespondenceDimension () const |
virtual int | maxCorrespondenceDimension () const |
bool | denormalize (fvector &srcdest, const vector< fpoint > &scale, const vector< fpoint > &shift) const |
bool | denormalize (dvector &srcdest, const vector< dpoint > &scale, const vector< dpoint > &shift) const |
bool | convert (const fvector &src, hMatrix3D< float > &dest) const |
bool | convert (const dvector &src, hMatrix3D< float > &dest) const |
bool | convert (const fvector &src, fmatrix &dest) const |
bool | convert (const dvector &src, dmatrix &dest) const |
fpoint | transform (const fpoint &pt, const fvector &transf) const |
dpoint | transform (const dpoint &pt, const dvector &transf) const |
translationScaleEstimator & | copy (const translationScaleEstimator &other) |
translationScaleEstimator & | operator= (const translationScaleEstimator &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
This class estimates a translation and common scale for the x and y coordinates, i.e.
the following transformation:
x_new = s * x + tx y_new = s * y + ty
The resulting least squares problem is solved by a cholesky decomposition.
Such a transformation can be used to correct distortion errors when the camera rotation and translation is known a priori, but errorprone.
lti::translationScaleEstimator::translationScaleEstimator | ( | ) |
Default constructor.
lti::translationScaleEstimator::translationScaleEstimator | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::translationScaleEstimator::translationScaleEstimator | ( | const translationScaleEstimator & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::translationScaleEstimator::~translationScaleEstimator | ( | ) | [virtual] |
Destructor.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<dpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | dvector the estimated transform. | |
error | dvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method is used by robost estimators using a monte carlo approach.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<dpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | dvector the estimated transform. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<dpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | dvector the estimated transform. | |
error | dvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<dpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | dvector the estimated transform. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<fpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
error | fvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method is used by robost estimators using a monte carlo approach.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<fpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<fpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
error | fvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<fpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
fvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<ipoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
error | fvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
This method is used by robost estimators using a monte carlo approach.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<ipoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
fvector & | error | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
This method calls the apply without the residual first, and then computes the residual.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<ipoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. | |
error | fvector containing the deviation of each point from the estimated transform. Usually this is the residual or elementwise squared residual. |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest | |||
) | const [virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
All points of one point set give a matrix row, whereas all elements of a specifec correspondence stand in a matrix column.
src | matrix<ipoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
dest | fvector the estimated transform. |
Implements lti::homographyEstimatorBase.
virtual functor* lti::translationScaleEstimator::clone | ( | ) | const [virtual] |
Returns a pointer to a clone of this functor.
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::computeResidual | ( | const matrix< dpoint > & | src, | |
const dvector & | transform, | |||
dvector & | dest | |||
) | const [virtual] |
Compute the residual for the given correspondences and transformation vector.
src | matrix<dpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
transform | dvector with the transformation | |
dest | dvector with the residual |
Implements lti::homographyEstimatorBase.
virtual bool lti::translationScaleEstimator::computeResidual | ( | const matrix< fpoint > & | src, | |
const fvector & | transform, | |||
fvector & | dest | |||
) | const [virtual] |
Compute the residual for the given correspondences and transformation vector.
src | matrix<fpoint> with the point sets. All points of the same image stand in a row. The correspondences in another image stand in the according columns. | |
transform | fvector with the transformation | |
dest | fvector with the residual |
Implements lti::homographyEstimatorBase.
bool lti::translationScaleEstimator::convert | ( | const dvector & | src, | |
hMatrix3D< float > & | dest | |||
) | const [virtual] |
Converts the estimated vector into a hMatrix3D<float>, which is e.g.
used by geometricTransform.
src | dvector the estimated transform. | |
dest | hMatrix3D<float> the estimated transform as a hMatrix3D. |
Implements lti::homographyEstimatorBase.
bool lti::translationScaleEstimator::convert | ( | const fvector & | src, | |
hMatrix3D< float > & | dest | |||
) | const [virtual] |
Converts the estimated vector into a hMatrix3D<float>, which is e.g.
used by geometricTransform.
src | fvector the estimated transform. | |
dest | hMatrix3D<float> the estimated transform as a hMatrix3D. |
Implements lti::homographyEstimatorBase.
translationScaleEstimator& lti::translationScaleEstimator::copy | ( | const translationScaleEstimator & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::homographyEstimatorBase.
bool lti::translationScaleEstimator::denormalize | ( | dvector & | srcdest, | |
const vector< dpoint > & | scale, | |||
const vector< dpoint > & | shift | |||
) | const [virtual] |
A transform estimated on normalized data usually differs from the transform of the original data.
Considering the normalization performed this methods computes the transform which applies to the original data.
srcdest | the normalized transform. The result will be left here too. | |
scale | a vector containing the scale applied to each point set. | |
shift | a vector containing the shift of each scaled point set. |
Implements lti::homographyEstimatorBase.
bool lti::translationScaleEstimator::denormalize | ( | fvector & | srcdest, | |
const vector< fpoint > & | scale, | |||
const vector< fpoint > & | shift | |||
) | const [virtual] |
A transform estimated on normalized data usually differs from the transform of the original data.
Considering the normalization performed this methods computes the transform which applies to the original data.
srcdest | the normalized transform. The result will be left here too. | |
scale | a vector containing the scale applied to each point set. | |
shift | a vector containing the shift of each scaled point set. |
Implements lti::homographyEstimatorBase.
const parameters& lti::translationScaleEstimator::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::homographyEstimatorBase.
virtual const char* lti::translationScaleEstimator::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("translationScaleEstimator").
Reimplemented from lti::homographyEstimatorBase.
virtual int lti::translationScaleEstimator::maxCorrespondenceDimension | ( | ) | const [virtual] |
Returns the maximum dimension of a correspondence, e.g.
the maximum dimension of a correspondence pair is 2, whereas transformEstimator running on n-tuples may allow an infinite number. Each derived transform estimator only works on correspondences of priori defined dimensions.
Implements lti::homographyEstimatorBase.
virtual int lti::translationScaleEstimator::minCorrespondenceDimension | ( | ) | const [virtual] |
Returns the mininum dimension of a correspondence, e.g.
the minimum dimension of a correspondence pair is 2. Each derived transform estimator only works on correspondences of priori defined dimensions.
Implements lti::homographyEstimatorBase.
virtual int lti::translationScaleEstimator::minNumberCorrespondences | ( | ) | const [virtual] |
Returns the minimum number of correspondences required to estimate the transform.
Implements lti::homographyEstimatorBase.
translationScaleEstimator& lti::translationScaleEstimator::operator= | ( | const translationScaleEstimator & | other | ) |
Alias for copy member.
other | the functor to be copied |
Reimplemented from lti::homographyEstimatorBase.
dpoint lti::translationScaleEstimator::transform | ( | const dpoint & | pt, | |
const dvector & | transf | |||
) | const [inline, virtual] |
This is a fast short cut used by the special robust estimator homographyVerification in the main loop.
pt | fpoint the point to be transformed | |
transf | fvector with the transformation, which e.g. was computed by an apply. |
Implements lti::homographyEstimatorBase.
References lti::genericVector< T >::begin(), lti::tpoint< T >::x, and lti::tpoint< T >::y.
fpoint lti::translationScaleEstimator::transform | ( | const fpoint & | pt, | |
const fvector & | transf | |||
) | const [inline, virtual] |
This is a fast short cut used by the special robust estimator homographyVerification in the main loop.
pt | fpoint the point to be transformed | |
transf | fvector with the transformation, which e.g. was computed by an apply. |
Implements lti::homographyEstimatorBase.
References lti::genericVector< T >::begin(), lti::tpoint< T >::x, and lti::tpoint< T >::y.