Public Types | Public Member Functions | Protected Types

TRTK::Polynomial< T > Class Template Reference

Interface class for all polynomials. More...

#include <Polynomial.hpp>

Inheritance diagram for TRTK::Polynomial< T >:

List of all members.

Public Types

enum  Error {
  DIVISION_BY_ZERO, INVALID_ARGUMENT, NOT_ENOUGH_POINTS, UNEQUAL_NUMBER_OF_POINTS,
  UNKNOWN_ERROR, WRONG_COORDINATE_SIZE
}
typedef T value_type
typedef Coordinate< T > Point
typedef Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
MatrixXT

Public Member Functions

virtual MatrixXT & getCoefficients ()=0
 Returns the internal coefficients in form of a matrix representation.
virtual const MatrixXT & getCoefficients () const =0
 Returns the internal coefficients in form of a matrix representation.
virtual T estimate (Range< Point > source_points, Range< Point > target_points, Range< T > weights=Range< T >())=0
 Estimates the polynomial function from two corresponding point sets; points can be weighted.
virtual T estimate (Iterator< Point > source_points_first, Iterator< Point > source_points_last, Iterator< Point > target_points_first, Iterator< Point > target_points_last, Iterator< T > weights_first=Iterator< T >(), Iterator< T > weights_last=Iterator< T >())=0
 Estimates the polynomial function from two corresponding point sets; points can be weighted.
virtual Point operator* (const Point &) const =0
 Transforms a point with the internally saved transformation.
virtual Point transform (const Point &) const =0
 Transforms a point with the internally saved transformation.
virtual Polynomial< T > & reset ()=0
 Sets the internal coefficients such that the polynomial function is the identity function.

Protected Types

typedef Coordinate< T > coordinate_type
typedef Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
VectorXT
typedef Eigen::Matrix< T, 2, 1 > Vector2T
typedef Eigen::Matrix< T, 3, 1 > Vector3T

Detailed Description

template<class T>
class TRTK::Polynomial< T >

Interface class for all polynomials.

The polynomial classes provide means to estimate and compute univariate or multivariate polynomials of various degree.

See also:
Coordinate
Author:
Christoph Haenisch
Version:
1.0.0
Date:
last changed on 2013-04-05

Definition at line 59 of file Polynomial.hpp.


Member Function Documentation

template<class T>
T TRTK::Polynomial< T >::estimate ( Range< Point source_points,
Range< Point target_points,
Range< T >  weights = Range<T>() 
) [pure virtual]

Estimates the polynomial function from two corresponding point sets; points can be weighted.

Template Parameters:
Tscalar type

The input parameters are ranges [first, last) of a sequence (e.g. a STL container like vector). The last elements are not included in the ranges which coincides with the convention in the STL.

Source and target points as well as weights must correspond to each other. If no weights are given the weights are assumed to be equal to one.

Example:

 typedef Polynomial<double>::Point Point;

 vector<Point> source_points;
 vector<Point> target_points;

 // ...

 Polynomial<double> * polynomial = new ConcretePolynomial<double>;

 polynomial->estimate(make_range(source_points), make_range(target_points));
Returns:
Returns the RMSE of the estimated transformation.

Implemented in TRTK::GenericPolynomial< T >, and TRTK::TrivariateQuadraticPolynomial< T >.

template<class T>
T TRTK::Polynomial< T >::estimate ( Iterator< Point source_points_first,
Iterator< Point source_points_last,
Iterator< Point target_points_first,
Iterator< Point target_points_last,
Iterator< T >  weights_first = Iterator<T>(),
Iterator< T >  weights_last = Iterator<T>() 
) [pure virtual]

Estimates the polynomial function from two corresponding point sets; points can be weighted.

Template Parameters:
Tscalar type

The input parameters are ranges [first, last) of a sequence (e.g. a STL container like vector). The last elements are not included in the ranges which coincides with the convention in the STL.

Source and target points as well as weights must correspond to each other. If no weights are given the weights are assumed to be equal to one.

Example:

 typedef Polynomial<double>::Point Point;

 vector<Point> source_points;
 vector<Point> target_points;

 // ...

 Polynomial<double> * polynomial = new ConcretePolynomial<double>;

 polynomial->estimate(make_iterator(source_points.begin()),
                      make_iterator(source_points.end()),
                      make_iterator(target_points.begin()),
                      make_iterator(target_points.end()));
Returns:
Returns the RMSE of the estimated transformation.

Implemented in TRTK::GenericPolynomial< T >, and TRTK::TrivariateQuadraticPolynomial< T >.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines