34 #include <Utils/GenSynthMatches.hh>
35 #include <Base/Image/ImageIO.hh>
36 #include <Base/Geometry/TrifocalTensorBase.hh>
38 #include <Base/Common/BIASpragma.hh>
43 #define DEFAULT_PARA_FILE_NAME "TFT.ini"
46 int main(
int argc,
char *argv[])
57 bool FoundDefaultParaFile=
true;
58 ifstream is(DEFAULT_PARA_FILE_NAME);
61 if (DEBUG) cerr <<
"reading "<<DEFAULT_PARA_FILE_NAME<<
" failed"<<endl;
62 FoundDefaultParaFile=
false;
64 if (DEBUG) cerr <<
"reading "<<DEFAULT_PARA_FILE_NAME<<endl;
70 BIASERR(
"error parsing command line");
74 if ((!FoundDefaultParaFile) && (*para.
GetParamString(
"readconfig")==
"")) {
75 cerr <<
"no parameter file found, writing default to "
76 <<DEFAULT_PARA_FILE_NAME<<
"\n";
82 BIASERR(
"must be at least 3 images for trifocal tensor");
88 gsm.WriteData(
"data.txt");
93 gsm.DrawTrue(im, 0, 2);
98 gsm.DrawNoisy(im, 0, 2);
104 vector<HomgPoint2D> m1, m2, m3;
105 vector<RMatrixBase> R(3);
106 vector<HomgPoint3D> C(3);
108 gsm.GetNormalizedPoints(0, m1);
109 gsm.GetNormalizedPoints(1, m2);
110 gsm.GetNormalizedPoints(2, m3);
114 tft.
Compose(R[0], R[1], R[2], C[0], C[1], C[2]);
127 for (
int i=0; i<num; i++){
130 cerr << setw(3)<<i<<
" : " << res.
NormL1() <<
"\t"<< res.
NormL2()<<endl;
int ReadParameter(const std::string &filename)
read values for parameters from file
int ParseCommandLine(int &argc, char *argv[])
scan command line arguments for valid parameters
class for generating synthetic matches
std::string * GetParamString(const std::string &name) const
int WriteParameter(const std::string &filename)
store complete set of parameter in file if write_comments is set, alo the help strings are written to...
int * GetParamInt(const std::string &name) const
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
This class Param provides generic support for parameters.
void SetWriteOptions(bool indent, bool comments, bool enhanced)
void CheckPointCorr(HomgPoint2D &p1, HomgPoint2D &p2, HomgPoint2D &p3, Matrix3x3< double > &res)
void Compose(RMatrixBase &R1, RMatrixBase &R2, RMatrixBase &R3, Vector3< double > &C1, Vector3< double > &C2, Vector3< double > &C3)
composition for "normalized" (with K^-1) image points