latest version v1.9 - last update 10 Apr 2010 |
A parent class for estimating a transform that can be converted to a homography. More...
#include <ltiHomographyEstimatorBase.h>
Classes | |
class | parameters |
The parameters for the class homographyEstimatorBase. More... | |
Public Member Functions | |
homographyEstimatorBase () | |
homographyEstimatorBase (const parameters &par) | |
homographyEstimatorBase (const homographyEstimatorBase &other) | |
virtual | ~homographyEstimatorBase () |
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 |
bool | denormalize (fvector &srcdest, const vector< fpoint > &scale, const vector< fpoint > &shift) const =0 |
bool | denormalize (dvector &srcdest, const vector< dpoint > &scale, const vector< dpoint > &shift) const =0 |
virtual bool | convert (const fvector &src, hMatrix3D< float > &dest) const =0 |
virtual bool | convert (const dvector &src, hMatrix3D< float > &dest) const =0 |
virtual fpoint | transform (const fpoint &pt, const fvector &transf) const =0 |
virtual dpoint | transform (const dpoint &pt, const dvector &transf) const =0 |
homographyEstimatorBase & | copy (const homographyEstimatorBase &other) |
homographyEstimatorBase & | operator= (const homographyEstimatorBase &other) |
virtual functor * | clone () const =0 |
const parameters & | getParameters () const |
A parent class for estimating a transform that can be converted to a homography.
For example all transform estimators, whose result may be used by geometricTransform, should be derived from this class. These classes must provide an interface to convert their result to hMatrix3D.
The results of all homography estimators can be improved and verified by registering the image planes and computing a similarity measure, lti::homographyVerification. To allow efficient computations inside the homographyVerification, please implement a tranform-method.
The robust estimatorBase performs data normalization on request, whereas the derived classes do not.
If you derive a class please remember to support the paramter for returning a squared error measure (e.g. squared residual) instead of the error (e.g. residual), and thus spare taking the square root.
lti::homographyEstimatorBase::homographyEstimatorBase | ( | ) |
Default constructor.
lti::homographyEstimatorBase::homographyEstimatorBase | ( | const parameters & | par | ) |
Construct a functor using the given parameters.
lti::homographyEstimatorBase::homographyEstimatorBase | ( | const homographyEstimatorBase & | other | ) |
Copy constructor.
other | the object to be copied |
virtual lti::homographyEstimatorBase::~homographyEstimatorBase | ( | ) | [virtual] |
Destructor.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a homography 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 homography. | |
error | dvector containing the deviation of each point from the estimated homography. 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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a homography from the supplied point sets, whereby only the points specified in the index vector are considered.
This method is used by robost estimatorBases 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 homography. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest, | |||
dvector & | error | |||
) | const [pure virtual] |
Estimates a homography 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 homography. | |
error | dvector containing the deviation of each point from the estimated homography. Usually this is the residual or elementwise squared residual. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< dpoint > & | src, | |
dvector & | dest | |||
) | const [pure virtual] |
Estimates a homography from the supplied point sets, where all points are considered.
Please implement efficient code using iterators here. Not all robust estimatorBases use a random sampling approach. Some estimatorBases consider all input points and weight them according to their deviation from the homography 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 homography. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a homography 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 homography. | |
error | fvector containing the deviation of each point from the estimated homography. 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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
const ivector & | indices, | |||
int | numCorrespondences | |||
) | const [pure virtual] |
Estimates a homography from the supplied point sets, whereby only the points specified in the index vector are considered.
This method is used by robost estimatorBases 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 homography. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest, | |||
fvector & | error | |||
) | const [pure virtual] |
Estimates a homography 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<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 homography. | |
error | fvector containing the deviation of each point from the estimated homography. Usually this is the residual or elementwise squared residual. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::apply | ( | const matrix< fpoint > & | src, | |
fvector & | dest | |||
) | const [pure virtual] |
Estimates a homography from the supplied point sets, where all points are considered.
Please implement efficient code using iterators here. Not all robust estimatorBases use a random sampling approach. Some estimatorBases consider all input points and weight them according to their deviation from the homography 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 homography. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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. | |
indices | ivector with the indices of the relevant points. | |
numCorrespondences | the first numCorrespondences indices are considered. |
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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.
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::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual functor* lti::homographyEstimatorBase::clone | ( | ) | const [pure virtual] |
Returns a pointer to a clone of this functor.
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::convert | ( | const dvector & | src, | |
hMatrix3D< float > & | dest | |||
) | const [pure 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. |
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual bool lti::homographyEstimatorBase::convert | ( | const fvector & | src, | |
hMatrix3D< float > & | dest | |||
) | const [pure 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. |
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
homographyEstimatorBase& lti::homographyEstimatorBase::copy | ( | const homographyEstimatorBase & | other | ) |
Copy data of "other" functor.
other | the functor to be copied |
Reimplemented from lti::transformEstimator.
Reimplemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
bool lti::homographyEstimatorBase::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::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
const parameters& lti::homographyEstimatorBase::getParameters | ( | ) | const |
Returns used parameters.
Reimplemented from lti::transformEstimator.
Reimplemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual const char* lti::homographyEstimatorBase::getTypeName | ( | ) | const [virtual] |
Returns the name of this type ("homographyEstimatorBase").
Reimplemented from lti::transformEstimator.
Reimplemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual int lti::homographyEstimatorBase::maxCorrespondenceDimension | ( | ) | const [pure virtual] |
Returns the maximum dimension of a correspondence, e.g.
the maximum dimension of a correspondence pair is 2, whereas homographyEstimatorBase running on n-tuples may allow an infinite number. Each derived homography estimatorBase only works on correspondences of priori defined dimensions.
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual int lti::homographyEstimatorBase::minCorrespondenceDimension | ( | ) | const [pure virtual] |
Returns the mininum dimension of a correspondence, e.g.
the minimum dimension of a correspondence pair is 2. Each derived homography estimatorBase only works on correspondences of priori defined dimensions.
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual int lti::homographyEstimatorBase::minNumberCorrespondences | ( | ) | const [pure virtual] |
Returns the minimum number of correspondences required to estimate the homography.
Implements lti::transformEstimator.
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
homographyEstimatorBase& lti::homographyEstimatorBase::operator= | ( | const homographyEstimatorBase & | other | ) |
Alias for copy member.
other | the functor to be copied |
Reimplemented from lti::transformEstimator.
Reimplemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual dpoint lti::homographyEstimatorBase::transform | ( | const dpoint & | pt, | |
const dvector & | transf | |||
) | const [pure virtual] |
This is a fast short cut used in the special robust estimator homographyVerification in the main loop.
Please implement this method inline.
pt | fpoint the point to be transformed | |
transf | fvector with the transformation, which e.g. was computed by an apply. |
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.
virtual fpoint lti::homographyEstimatorBase::transform | ( | const fpoint & | pt, | |
const fvector & | transf | |||
) | const [pure virtual] |
This is a fast short cut used by the special robust estimator homographyVerification in the main loop.
Please implement this method inline.
pt | fpoint the point to be transformed | |
transf | fvector with the transformation, which e.g. was computed by an apply. |
Implemented in lti::homography8DofEstimator, lti::homography9DofEstimator, and lti::translationScaleEstimator.