#include <Geometry/FMatrixEstimation.hh>
#include <MathAlgo/SVD.hh>
using namespace BIAS;
using namespace std;
typedef vector<HomgPoint2D> PointVector;
void
loadFlowVectors(char* filename, PointVector& match1,
PointVector& match2)
{
match1.clear();
match2.clear();
FILE *stream;
stream = fopen ( filename , "rb" );
char *buffer = new char[256];
float x1, y1, w1, x2, y2, w2;
bool done=false;
while (!done)
{
char *r = fgets(buffer, 256, stream);
if (r == NULL) exit(-1);
if (buffer[0] == '#' || buffer[0] == '\n') continue;
if (feof(stream)) {
done=true;
break;
}
sscanf(buffer, "%f %f %f %f %f %f \n", &x1, &y1, &w1, &x2, &y2, &w2);
}
fclose(stream);
}
int main(int argc, char *argv[])
{
vector<HomgPoint2D> p1, p2;
if (argc>=2){
loadFlowVectors(argv[1], p1, p2);
for (int i=0; i<(int)p1.size(); i++){
cout << p1[i]<<"\t"<<p2[i]<<endl;
}
} else {
cerr << argv[0]<<" pointfile\n";
return -1;
}
vector<FMatrix> Fvec;
BIASERR("error estimating F");
}
for (int i=0; i<(int)Fvec.size(); i++){
cout << "singular values of "<<i<<"th solution are "
<<svd.
GetS()[0]<<
"\t"<<svd.
GetS()[1]<<
"\t"<<svd.
GetS()[2]<<endl;
}
return 0;
}