Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleMatchDataBase.cpp

Example for generating synthetic matches using database , GenSynthMatches

Author
MIP
/*
This file is part of the BIAS library (Basic ImageAlgorithmS).
Copyright (C) 2003-2009 (see file CONTACT for details)
Multimediale Systeme der Informationsverarbeitung
Institut fuer Informatik
Christian-Albrechts-Universitaet Kiel
BIAS is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
BIAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with BIAS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/** @example ExampleMatchDataBase.cpp
* @relates MatchDataBase, GenSynthMatches
@ingroup g_examples
@brief Example for generating synthetic matches using database
@author MIP */
#include <Utils/MatchDataBase.hh>
#include <Utils/GenSynthMatches.hh>
#include <Base/Common/BIASpragma.hh>
#include <iostream>
using namespace BIAS;
using namespace std;
int main(int argc, char *argv[])
{
Param para;
GenSynthMatches gsm(para);
const string fname="mdb.txt";
gsm.Write(fname);
std::cout << "original: \n"<<gsm << endl;
MatchDataBase mdb(para), mdb2(para), mdb3(para);
mdb.Read(fname);
std::cout << "read: \n"<< mdb << endl;
vector<RMatrixBase> R;
vector<HomgPoint3D> C;
vector<vector<HomgPoint2D> > p, np;
gsm.GetK(K);
gsm.GetR(R);
gsm.GetC(C);
gsm.GetPoints(p);
mdb2.SetData(K, R, C, p);
std::cout << "SetData: \n"<< mdb2 <<endl;
mdb3.SetNormalizedData(K, R, C, np);
std::cout << "SetNormalizedData: \n"<< mdb3 <<endl;
std::cout << "read: "<<boolalpha<<(gsm==mdb)<<endl;
std::cout << "SetData: "<<boolalpha<<(gsm==mdb2)<<endl;
std::cout << "SetNormalizedData: "<<boolalpha<<(gsm==mdb3)<<endl;
return 0;
}