latest version v1.9 - last update 10 Apr 2010 |
A base class for estimating the fundamental matrix with a least squares approach. More...
#include <ltiFMatrixEstimatorBase.h>
Classes | |
class | parameters |
The parameters for the class fMatrixEstimatorBase. More... | |
Public Member Functions | |
fMatrixEstimatorBase () | |
fMatrixEstimatorBase (const parameters &par) | |
fMatrixEstimatorBase (const fMatrixEstimatorBase &other) | |
virtual | ~fMatrixEstimatorBase () |
virtual const char * | getTypeName () const |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest) const =0 |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, fvector &error) const =0 |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | apply (const matrix< ipoint > &src, fvector &dest, fvector &error, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest) const =0 |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, fvector &error) const =0 |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | apply (const matrix< fpoint > &src, fvector &dest, fvector &error, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest) const =0 |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, dvector &error) const =0 |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | apply (const matrix< dpoint > &src, dvector &dest, dvector &error, const ivector &indices, int numCorrespondences) const =0 |
virtual bool | computeResidual (const matrix< fpoint > &src, const fvector &transform, fvector &dest) const =0 |
virtual bool | computeResidual (const matrix< dpoint > &src, const dvector &transform, dvector &dest) const =0 |
virtual int | minNumberCorrespondences () const =0 |
virtual int | minCorrespondenceDimension () const =0 |
virtual int | maxCorrespondenceDimension () const =0 |
virtual bool | denormalize (fvector &srcdest, const vector< fpoint > &scale, const vector< fpoint > &shift) const =0 |
virtual bool | denormalize (dvector &srcdest, const vector< dpoint > &scale, const vector< dpoint > &shift) const =0 |
fMatrixEstimatorBase & | copy (const fMatrixEstimatorBase &other) |
fMatrixEstimatorBase & | operator= (const fMatrixEstimatorBase &other) |
virtual functor * | clone () const =0 |
const parameters & | getParameters () const |
A base class for estimating the fundamental matrix with a least squares approach.
This class is here because a simultanous estimator for the fundamental matrix and a radial distortion is planned.
A note for developers of derived fmatrix classes: The header of this class contains an hidden template base class for template helpers. This template base helper must not be used by any classes other than least squares fundamental matrix estimators, though. Therefore it is not included in the doxygen documentation.
lti::fMatrixEstimatorBase::fMatrixEstimatorBase | ( | ) |
Default constructor.
lti::fMatrixEstimatorBase::fMatrixEstimatorBase | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::fMatrixEstimatorBase::fMatrixEstimatorBase | ( | const fMatrixEstimatorBase & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::fMatrixEstimatorBase::~fMatrixEstimatorBase | ( | ) | [virtual] |
Destructor.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
Usually 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure 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 | which rows of the src matrix have to be considered. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Usually 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Please implement efficient code using iterators here. Not all robust estimators use a random sampling approach. Some estimators consider all input points and weight them according to their deviation from the transform computed at the prior iteration.
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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
Usually 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. All correspondences are considered, discarding the valid indices. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure 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 | fvector the estimated transform. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Usually this method calls the apply without the residual first, and then computes the residual.
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. All points of one point set give a matrix row, whereas all elements of a specific correspondence stand in a matrix column. | |
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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Please implement efficient code using iterators here. Not all robust estimators use a random sampling approach. Some estimators consider all input points and weight them according to their deviation from the transform computed at the prior iteration.
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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
fvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, whereby only the points specified in the index vector are considered.
Usually 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. All correspondences are considered, discarding the valid indices. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest, | |||
fvector & | error | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Usually this method calls the apply without the residual first, and then computes the residual.
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. All points of one point set give a matrix row, whereas all elements of a specific correspondence stand in a matrix column. | |
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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::apply | ( | const matrix< ipoint > & | src, | |
fvector & | dest | |||
) | const [pure virtual] |
Estimates a transform from the supplied point sets, where all points are considered.
Please implement efficient code using iterators here. Not all robust estimators use a random sampling approach. Some estimators consider all input points and weight them according to their deviation from the transform computed at the prior iteration.
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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual functor* lti::fMatrixEstimatorBase::clone | ( | ) | const [pure virtual] |
Returns a pointer to a clone of this functor.
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::computeResidual | ( | const matrix< dpoint > & | src, | |
const dvector & | transform, | |||
dvector & | dest | |||
) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::computeResidual | ( | const matrix< fpoint > & | src, | |
const fvector & | transform, | |||
fvector & | dest | |||
) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
fMatrixEstimatorBase& lti::fMatrixEstimatorBase::copy | ( | const fMatrixEstimatorBase & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::transformEstimator.
Reimplemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::denormalize | ( | dvector & | srcdest, | |
const vector< dpoint > & | scale, | |||
const vector< dpoint > & | shift | |||
) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual bool lti::fMatrixEstimatorBase::denormalize | ( | fvector & | srcdest, | |
const vector< fpoint > & | scale, | |||
const vector< fpoint > & | shift | |||
) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
const parameters& lti::fMatrixEstimatorBase::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::transformEstimator.
Reimplemented in lti::fMatrixEstimator.
virtual const char* lti::fMatrixEstimatorBase::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("fMatrixEstimatorBase").
Reimplemented from lti::transformEstimator.
Reimplemented in lti::fMatrixEstimator.
virtual int lti::fMatrixEstimatorBase::maxCorrespondenceDimension | ( | ) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual int lti::fMatrixEstimatorBase::minCorrespondenceDimension | ( | ) | const [pure 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::transformEstimator.
Implemented in lti::fMatrixEstimator.
virtual int lti::fMatrixEstimatorBase::minNumberCorrespondences | ( | ) | const [pure virtual] |
Returns the minimum number of correspondences required to estimate the transform.
Implements lti::transformEstimator.
Implemented in lti::fMatrixEstimator.
fMatrixEstimatorBase& lti::fMatrixEstimatorBase::operator= | ( | const fMatrixEstimatorBase & | other | ) |
Alias for copy member.
other | the functor to be copied |
Reimplemented from lti::transformEstimator.
Reimplemented in lti::fMatrixEstimator.