15 #include <boost/concept_check.hpp>
18 #include <eigen3/Eigen/Dense>
21 namespace Projection {
30 Point2D (
double _x = 0.,
double _y = 0.): x_ (_x), y_ (_y) {}
42 double x ()
const {
return x_;}
45 double &
x () {
return x_;}
48 double y ()
const {
return y_;}
51 double &
y () {
return y_;}
85 const std::vector<Point2D> &r2) {
86 assert(r1.size() == 3);
87 assert(r2.size() == 3);
90 a << r1[0].x(), r1[0].y(), 1.,
91 r1[1].x(), r1[1].y(), 1.,
92 r1[2].x(), r1[2].y(), 1.;
95 b << r2[0].x(), r2[0].y(),
99 return a.jacobiSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(b);
103 #endif // #ifndef PROJECTION_HPP
Point2D(double _x=0., double _y=0.)
Construct a point with two double.
double & y()
Access to ordinate, modification is possible.
double & x()
Access to abscissa, modification is possible.
Eigen::Matrix< double, 3, 2 > Coefficients
Type for projection coefficients.
Coefficients computeCoefficients(const std::vector< Point2D > &r1, const std::vector< Point2D > &r2)
Compute the projection coefficients.
double y() const
Access to ordinate, modification is not possible.
Point2D(const Point2D &p)
Copy constructor.
Point2D & operator=(const Point2D &p)
Copy operator.
double x() const
Access to abscissa, modification is not possible.