33 #include <Geometry/FMatrixEstimation.hh>
34 #include <MathAlgo/SVD.hh>
39 typedef vector<HomgPoint2D> PointVector;
42 loadFlowVectors(
char* filename, PointVector& match1,
48 stream = fopen ( filename ,
"rb" );
49 char *buffer =
new char[256];
50 float x1, y1, w1, x2, y2, w2;
54 char *r = fgets(buffer, 256, stream);
55 if (r == NULL) exit(-1);
56 if (buffer[0] ==
'#' || buffer[0] ==
'\n')
continue;
61 sscanf(buffer,
"%f %f %f %f %f %f \n", &x1, &y1, &w1, &x2, &y2, &w2);
68 int main(
int argc,
char *argv[])
70 vector<HomgPoint2D> p1, p2;
73 loadFlowVectors(argv[1], p1, p2);
74 for (
int i=0; i<(int)p1.size(); i++){
75 cout << p1[i]<<
"\t"<<p2[i]<<endl;
78 cerr << argv[0]<<
" pointfile\n";
86 BIASERR(
"error estimating F");
90 for (
int i=0; i<(int)Fvec.size(); i++){
92 cout <<
"singular values of "<<i<<
"th solution are "
93 <<svd.
GetS()[0]<<
"\t"<<svd.
GetS()[1]<<
"\t"<<svd.
GetS()[2]<<endl;
computes and holds the singular value decomposition of a rectangular (not necessarily quadratic) Matr...
int Compute(const Matrix< double > &M, double ZeroThreshold=DEFAULT_DOUBLE_ZERO_THRESHOLD)
set a new matrix and compute its decomposition.
functions for estimating a fundamental matrix (FMatrix) given a set of 2d-2d correspondences (no outl...
const Vector< double > & GetS() const
return S which is a vector of the singular values of A in descending order.
int SevenPoint(std::vector< BIAS::FMatrix > &Fvec, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2)
compute a vector of FMatrices from seven point correspondences
class BIASGeometryBase_EXPORT HomgPoint2D