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

Example Daimler .bog reader

Author
Jan Woetzel
/*
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 ExampleLoadBOG_P.cpp
@brief Example Daimler .bog reader
@ingroup g_examples
@author Jan Woetzel
*/
#include <Base/Common/BIASpragma.hh>
// STD
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
// BIAS
#include <Base/Math/BogIO.hh>
#include <Base/Math/Vector3.hh>
#include <Base/Geometry/KMatrix.hh>
#include <Geometry/PMatrix.hh>
#include <Geometry/RMatrix.hh>
using namespace std;
using namespace BIAS;
// entry JW
int main(int argc, char** argv){
cout<<"started "<<argv[0]<<endl;
#ifdef BIAS_TESTS_DATA
string filename(BIAS_TESTS_DATA "calib01.bog");
#else
string filename("calib01.bog");
cout<<"BIAS_TESTS_DATA not defined."<<endl;
return -1;
#endif
if (argc>1) filename=argv[1];
cout<<"using filename "<<filename<<endl;
int result=0;
//bool ok=true;
if (0!=P.LoadBOG(filename)) return -2;
cout<<"P: "<<P<<endl;
P.Save("out_ExampleLoadBOGP.P");
LoadBogK(filename, K);
LoadBogRC(filename, R);
C.LoadBogTC(filename);
// compare:
cout<<"bog.K: "<<K<<endl;
cout<<"P.K : "<<P.GetK()<<endl;
cout<<"bog.R: "<<R<<endl;
cout<<"P.R : "<<P.GetR()<<endl;
double angle=0;
R.GetRotationAxisAngle(axis,angle);
cout<<"P.angle="<<angle<<" axis="<<axis<<endl;
cout<<"bog.C: "<<C<<endl;
cout<<"P.C : "<<P.GetC()<<endl;
return result; // OK.
}