26 #include "Matrix3x4.hh"
45 const T a0,
const T a1,
const T a2,
const T a3,
46 const T a4,
const T a5,
const T a6,
const T a7,
47 const T a8,
const T a9,
const T a10,
const T a11 )
68 BIASERR(
"cannot assign with operator= , num_rows=" << mat.
num_rows() <<
" num_cols= " << mat.
num_rows()
69 <<
" are'nt appropriate for a 3x4 Matrix3x4<T>.");
80 if ((rows != 3) || (cols != 4)) {
83 BIASERR(
"The size of a Matrix3x4<T> has to be 3 rows, 4 cols. newsize can't create a " <<rows<<
" x " <<cols<<
" Matrix3x4 !");
90 BIASASSERT( rows==3 );
91 BIASASSERT( cols==4 );
103 ifstream fs( filename.c_str() );
108 const unsigned int nMax=1024;
114 string::size_type pos=string::npos;
116 stringstream patternSS;
117 patternSS<<
"AddCameraKey { Time "<<setw(1)<<int(Time)<<
" Camera [ ";
118 string pattern=patternSS.str();
119 while (!fs.eof() && (fs) &&(!found)){
120 fs.getline(&caLine[0], nMax);
122 pos = strLine.find(pattern);
123 if (pos != string::npos){
128 sub = strLine.substr(pos, strLine.size()-pos );
130 istringstream iss( sub );
133 for (
unsigned int row=0; row<3; row++) {
134 for (
unsigned int col=0; col<4; col++) {
135 iss >> (*this)[row][col];
150 const unsigned int & index,
151 std::string & correspImgFilename,
155 fs.open(filenameParTxt.c_str() );
157 BIASERR(
"could not open "<<filenameParTxt);
160 unsigned int uNumOfMat=0;
167 BIASERR(
"index greater then number of matrices");
174 std::string tempImgFilename;
183 while (!found &&fs && !fs.eof())
188 BIASERR(
"Unexpected end of file");
192 for(uRow=0;uRow<3;uRow++)
193 for(uCol=0;uCol<3;uCol++)
195 fs>>tempK[uRow][uCol];
198 BIASERR(
"Unexpected end of file");
204 for(uRow=0;uRow<3;uRow++)
205 for(uCol=0;uCol<3;uCol++)
207 fs>>tempR[uRow][uCol];
210 BIASERR(
"Unexpected end of file");
216 for(uRow=0;uRow<3;uRow++)
220 BIASERR(
"Unexpected end of file");
234 for(uRow=0;uRow<3;uRow++)
235 for(uCol=0;uCol<3;uCol++)
237 tempMat[uRow][uCol]=mKr[uRow][uCol];
238 tempMat[uRow][uCol]=mKr[uRow][uCol];
239 tempMat[uRow][uCol]=mKr[uRow][uCol];
243 tempMat[0][3]=vKt[0];
244 tempMat[1][3]=vKt[1];
245 tempMat[2][3]=vKt[2];
250 correspImgFilename=tempImgFilename;
259 template class BIASMathBase_EXPORT BIAS::Matrix3x4<type>;\
Subscript num_cols() const
Matrix< T > & newsize(Subscript M, Subscript N)
int LoadBan(const std::string &filename, const unsigned int &Time=0)
Loads a PMatrix from .ban file given by AddCameraKey and Time index.
Matrix< T > & operator=(const TNT::Matrix< T > &mat)
assignment operators calling corresponding operator from base class if appropriate ...
Matrix3x4 & newsize(int rows, int cols)
just neccessary to avoid resizing of this 'fixed size' matrix because it is derived from the resizabl...
T * GetData()
get the pointer to the data array of the matrix (for faster direct memeory access) ...
is a 'fixed size' quadratic matrix of dim.
Matrix3x4()
default constructor
int LoadPARTXT(const std::string &filenameParTxt, const unsigned int &index, std::string &correspImgFilename, int &nTotal)
Load a PMatrix from a _par.txt (S.
class Vector3 contains a Vector of fixed dim.
matrix class with arbitrary size, indexing is row major.
virtual ~Matrix3x4()
destructor untested (04/17/2002)
Subscript num_rows() const
is a 'fixed size' rectangular matrix of dim.
Matrix3x4 & operator=(const Matrix< T > &mat)
assignment operator calling corresponding operator from base class if appropriate.