35 #include <Geometry/Triangulation.hh>
36 #include <Geometry/RMatrix.hh>
37 #include <Geometry/PMatrix.hh>
38 #include <Base/Geometry/KMatrix.hh>
56 pleft(
"415.692177 2.7975296e-05 320 -0\
57 0 415.692207 239.9999637 -0\
58 0 8.74228e-08 1 -0 "),
59 pright(
"415.692177 2.7975296e-05 320 -633.6\
60 0 415.692207 239.9999637 -475.199928\
61 0 8.74228e-08 1 -1.98");
63 HomgPoint2D point2d_im1(407.0, 100.0, 1.0), point2d_im2(419.0, 90.0, 1.0);
66 HomgPoint3D p3, p3d_real(5.087403297, -8.891034126, 26.40314484);
71 cerr <<
"projecting "<<p3d_real<<
" with pleft and pright: "<<endl;
72 ptl = pleft * p3d_real;
74 cerr <<
"left: "<< ptl << endl;
76 ptr = pright * p3d_real;
78 cerr <<
"right: "<< ptr << endl;
80 cerr <<endl<<
"triangulating from \n"<<point2d_im1<<
"\nP: "<<pleft<<endl
81 <<point2d_im2<<
"\nP: "<<pright<<endl;
82 if (triangulator.
Triangulate2D(pleft, pright, point2d_im1, point2d_im2,
83 p3, cov, dist, angle)!=0){
84 cerr <<
"error triangulating using GetNormRayWorldCoo"<<endl;
86 cerr <<
"triangulated: "<<p3<<
"\n with covariance matrix: "<<cov
87 <<
"\ndistance: "<<dist<<
"\tangle: "<<angle<<endl;
90 cerr <<endl<<
"triangulating with svd from points \n"<<point2d_im1<<
"\nP: "
91 <<pleft<<endl<<point2d_im2<<
"\nP: "<<pright<<endl;
92 if (triangulator.
Triangulate(pleft, pright, point2d_im1, point2d_im2,
95 cerr <<
"error triangulating using GetNormRayWorldCoo"<<endl;
98 cerr <<
"triangulated: "<<p3<<endl;
102 cerr <<endl<<
"triangulating from theoretical points \n"<<ptl<<
"\nP: "
103 <<pleft<<endl <<point2d_im2<<
"\nP: "<<ptr<<endl;
105 p3, cov, dist, angle)!=0){
106 cerr <<
"error triangulating using GetNormRayWorldCoo"<<endl;
108 cerr <<
"triangulated: "<<p3<<
"\n with covariance matrix: "<<cov
109 <<
"\ndistance: "<<dist<<
"\tangle: "<<angle<<endl;
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
void Set(const HOMGPOINT3D_TYPE &x, const HOMGPOINT3D_TYPE &y, const HOMGPOINT3D_TYPE &z)
set elementwise with given 3 euclidean scalar values.
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
int Triangulate2D(PMatrix &P1, PMatrix &P2, HomgPoint2D &p1, HomgPoint2D &p2, HomgPoint3D &point3d, double &dist, double &angle)
does not use BackprojectPseudoInverse but get NormRayWorldCoo
Class for triangulation of 3Dpoints from 2D matches. Covariance matrix (refering to an uncertainty el...
int Triangulate(PMatrix &P1, PMatrix &P2, const HomgPoint2D &p1, const HomgPoint2D &p2, BIAS::Vector3< double > &point3d)
Triangulation for metric PMatrices (using C and Hinf)
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
describes a projective 3D -> 2D mapping in homogenous coordinates