32 #include "../FMatrix.hh"
33 #include "../FMatrixEstimation.hh"
34 #include "../PMatrixEstimation.hh"
35 #include "../PMatrixLinear.hh"
36 #include "../Triangulation.hh"
37 #include "../../Base/Math/Random.hh"
41 #define FMATRIX_FILENAME_SUFFIX ".FMatrix"
42 #define CORRESPONDENCE_FILENAME_SUFFIX ".corresp"
56 for (
unsigned int i=0; i<2; i++) {
71 for (
unsigned int y=0;y<3;y++) {
79 if (C[0] * R[0][2] >0.0) C[0] *= -1.0;
80 if (C[1] * R[1][2] >0.0) C[1] *= -1.0;
100 cout <<
"epipoles are "<<epi1<<
" and "<<epi2 <<endl;
107 cout <<
"validated epipoles are "<<epi1<<
" and "<<epi2 <<endl;
121 double BaselineMagnitude = (i==0)?1:-1;
125 cout <<
" TheoP2 = " << TheoP2 << endl;
130 FCheck.GetEpipolesHomogenized(epi1, epi2);
136 cout <<
"Direct P2 = " << P2 << endl;
138 FCheck.ComputeFromPMatrices(P1,P2);
139 FCheck.GetEpipolesHomogenized(epi1, epi2);
140 cout <<
"computed epipoles are "<<epi1<<
" and "<<epi2 <<endl<<endl<<endl;
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
double GetUniformDistributed(const double min, const double max)
on succesive calls return uniform distributed random variable between min and max ...
void ComputeFromFQuasiEuklid(BIAS::FMatrix &F, double BaselineMagnitude, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euc...
class representing a Fundamental matrix
void GetEpipolesHomogenized(HomgPoint2D &E1, HomgPoint2D &E2) const
same as above, additionally homogenizes epipoles
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
void set_identity()
Convert the PMatrixBase to 'identity' matrix, overriding the Matrix3x4 method: 1 0 0 0 0 1 0 0 0 0 1 ...
compute standard P1/P2 from F.
int ComputeFromFDirect(BIAS::FMatrix &F, const double &BaselineMagnitude, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euc...
int GetC(Vector3< double > &C)
computes translation vector origin world coo -> origin camera coo (center), uses decomposition, which is cached
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
describes a projective 3D -> 2D mapping in homogenous coordinates
Vector3< T > & Normalize()
normalize this vector to length 1
class for producing random numbers from different distributions
T Normalize()
divide this by biggest absolute entry, returns biggest entry
void SetIdentity()
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) ...
void Normalize()
scale P such that optical axis (first three entries of last row) has unit length