35 #include <Base/Common/BIASpragma.hh>
43 #include <bias_config.h>
44 #include <Base/Math/Matrix3x4.hh>
45 #include <Base/Math/Vector.hh>
50 int main(
int argc,
char* argv[] )
54 cout<<
"Starting "<<argv[0]<<endl;
55 #ifdef BIAS_TESTS_DATA
59 filename = string(BIAS_TESTS_DATA);
60 filename +=
"calib01.ban";
63 cout<<
"BIAS_TESTS_DATA not defined."<<endl;
73 cout<<
"trying to load "<<filename<<endl;
74 result = A .
LoadBan(filename, 2);
76 cout<<
"successfully loaded "<<filename<<endl
79 cout<<
"Error. couls not load "<<filename<<endl;
87 const double v[12] = {
88 405.1, -0.0678595, -96.8174, 3800.26,
89 -2.10686, -202.721, -68.4048, 3483.67,
90 -0.00379941, 0.00217521, -0.171449, 7.94237 };
92 cout<<
"DBG reference v is: "<<endl;
93 for (
unsigned int i=0; i<12;i++) cout<<v[i]<<
" ";
95 const double eps=1E-10;
96 for (
unsigned int i=0; i<12; i++) {
97 if (fabs(v[i] - A.
GetData()[i]) >eps){
98 cout<<
"Error: mismatch for element "<<i<<
" : "<<endl
100 <<
"but read : "<<A.
GetData()[i]
109 int errCode = A.
LoadBan(filename, 3);
111 cout<<
"Error: acces to Time 3 should return error but didn't."<<endl;
115 cout<<
"done with result = "<<result<<endl;
int LoadBan(const std::string &filename, const unsigned int &Time=0)
Loads a PMatrix from .ban file given by AddCameraKey and Time index.
T * GetData()
get the pointer to the data array of the matrix (for faster direct memeory access) ...