Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions | List of all members
BIAS::PMatrixBase Class Reference

describes a projective 3D -> 2D mapping in homogenous coordinates More...

#include <Base/Geometry/PMatrixBase.hh>

+ Inheritance diagram for BIAS::PMatrixBase:
+ Collaboration diagram for BIAS::PMatrixBase:

Public Types

typedef const T * const_iterator
 
typedef const T & const_reference
 
enum  E_ParametrizationType { AXIS_TIMES_ANGLE, AXIS_AND_ANGLE, EULER, QUATERNION }
 description of supported parametrization types More...
 
typedef T element_type
 
typedef T * iterator
 
typedef T * pointer
 
typedef T & reference
 
typedef Subscript size_type
 
typedef T value_type
 

Public Member Functions

void AbsIP ()
 absolute values of all elements of the matrix (in place) More...
 
Matrix< PMATRIX_TYPE > Adjoint () const
 computes the adjoint matrix More...
 
HomgPoint3D Backproject (const HomgPoint2D &x, double mu=1)
 Back projects image point x to 3D space and returns ray on which the 3D space point lies. More...
 
void clear ()
 stl conform interface More...
 
void Compose (const Matrix3x3< PMATRIX_TYPE > &K, const Matrix3x3< PMATRIX_TYPE > &R, const Vector3< PMATRIX_TYPE > &C)
 composes this from K, R and C using P = [ K R' | -K R' C ] with R' = transpose(R) More...
 
void Compose (const Matrix3x3< PMATRIX_TYPE > &K, const Matrix3x3< PMATRIX_TYPE > &R, const HomgPoint3D &C)
 
void Compose (const Matrix3x3< PMATRIX_TYPE > &R, const Vector3< PMATRIX_TYPE > &C)
 calibrated case, uses K=Identity More...
 
void Compose (const Matrix3x3< PMATRIX_TYPE > &R, const HomgPoint3D &C)
 calibrated case, uses K=Identity More...
 
void Compose (const Matrix3x3< PMATRIX_TYPE > &K, const Vector< double > &parametrization, const enum E_ParametrizationType param_type)
 Compose a projection matrix using a parametrization. More...
 
Subscript dim (Subscript d) const
 
void GaussJordan ()
 use the Gauss Jordan Algrithm to transform the matrix to reduced row echelon form. More...
 
Matrix< PMATRIX_TYPE > GetMax (Matrix< PMATRIX_TYPE > &m)
 returns an matrix the same size as the matrix n and m with the largest elements taken from n or m More...
 
Matrix< PMATRIX_TYPE > GetMin (Matrix< PMATRIX_TYPE > &m)
 returns an matrix the same size as the matrix n and m with the smallest elements taken from n or m More...
 
 initialize (M, N)
 
bool IsIdentity (double eps=0.0) const
 Checks if the matrix a an identity. More...
 
bool IsZero (double eps=0.0) const
 Checks if the matrix is a null matrix. More...
 
void Kronecker (Matrix< PMATRIX_TYPE > const B, Matrix< PMATRIX_TYPE > &dest) const
 Kronecker-product with matrix, result in dest. More...
 
Subscript lbound () const
 
int LoadBan (const std::string &filename, const unsigned int &Time=0)
 Loads a PMatrix from .ban file given by AddCameraKey and Time index. More...
 
int LoadBOG (const std::string &filename)
 Load a Daimler .bog fiel and compose a P matrix from it. More...
 
int LoadPARTXT (const std::string &filenameParTxt, const unsigned int &index, std::string &correspImgFilename, int &nTotal)
 Load a PMatrix from a _par.txt (S. More...
 
void Mult (const Vector4< PMATRIX_TYPE > &argvec, Vector3< PMATRIX_TYPE > &destvec) const
 matrix - vector multiplicate this matrix with Vector4, storing the result in destvec calculates: destvec = (this Matrix) * argvec More...
 
void Mult (const Matrix4x4< PMATRIX_TYPE > &argmat, Matrix3x4< PMATRIX_TYPE > &destmat) const
 matrix-matrix multiplication with Matrix4x4 storing the result in destmat More...
 
PMatrixBasenewsize (int rows, int cols)
 setting a new size different from 3x4 is not allowed for the fixed size P-Matrix overloads the general newsize from basec class More...
 
Matrix< T > & newsize (Subscript M, Subscript N)
 
Subscript num_cols () const
 
Subscript num_rows () const
 
reference operator() (Subscript i)
 
const_reference operator() (Subscript i) const
 
reference operator() (Subscript i, Subscript j)
 
const_reference operator() (Subscript i, Subscript j) const
 
PMatrixBaseoperator= (const PMatrixBase &mat)
 
T * operator[] (Subscript i)
 
const T * operator[] (Subscript i) const
 
 PMatrixBase ()
 default constructor More...
 
 PMatrixBase (const MatrixInitType &i)
 constructor setting identity or zero More...
 
 PMatrixBase (const std::string &s)
 
 PMatrixBase (const PMatrixBase &A)
 
 PMatrixBase (const Matrix3x4< PMATRIX_TYPE > &Amat_)
 
 PMatrixBase (const Matrix< PMATRIX_TYPE > &Amat)
 
 PMatrixBase (const Matrix3x3< PMATRIX_TYPE > &K, const Matrix3x3< PMATRIX_TYPE > &R, const Vector3< PMATRIX_TYPE > &C)
 Take R, K, C and compose PMatrixBase. More...
 
 PMatrixBase (const Matrix3x3< PMATRIX_TYPE > &R, const Vector3< PMATRIX_TYPE > &C)
 assume K=Identity and compose P More...
 
std::ostream & Print (std::ostream &s, const int width, const int precision, bool scientific=true) const
 
std::ostream & Print (std::ostream &s, const bool intCastOutput=false, const bool binaryOutput=false, const bool forceFullPrecision=false) const
 
std::ostream & PrintPretty (std::ostream &s, const std::string &name="", const int width=8, const bool alignLeft=true) const
 
std::istream & Read (std::istream &s, const bool intCastInput=false, const bool binaryInput=false)
 JW. More...
 
 set (value)
 
void set_identity ()
 Convert the PMatrixBase to 'identity' matrix, overriding the Matrix3x4 method: 1 0 0 0 0 1 0 0 0 0 1 0. More...
 
void SetFromVector (const Vector< PMATRIX_TYPE > &vals)
 Sets P-Matrix from a vector which contains the elements of P row wise. More...
 
void SetIdentity ()
 set the elements of this matrix to the matrix 1 0 0 0 0 1 0 0 0 0 1 0 which is no strict identity (!) More...
 
Subscript size () const
 
void SwapRows (const int i, const int r)
 swaps two rows More...
 
Matrix< PMATRIX_TYPE > Transpose () const
 transpose function, storing data destination matrix More...
 
void Vec (Vector< PMATRIX_TYPE > &dest) const
 vec-operator returns the elements of the matrix columwise as vector More...
 
virtual ~PMatrixBase ()
 destructor More...
 
Arithmetic
void Mult (const Matrix< PMATRIX_TYPE > &arg, Matrix< PMATRIX_TYPE > &result) const
 matrix multiplication, result is not allocated More...
 
void Mult (const Matrix< PMATRIX_TYPE > &arg)
 in Place matrix multiplication this is equal to M = M * arg, but faster More...
 
void Mult (const Vector< PMATRIX_TYPE > &arg, Vector< PMATRIX_TYPE > &result) const
 matrix vector multiplication, result is not allocated More...
 
void AddIP (const PMATRIX_TYPE &scalar)
 in place addition function More...
 
void AddIP (const Matrix< PMATRIX_TYPE > &arg)
 Adds arg to this. More...
 
void SubIP (const Matrix< PMATRIX_TYPE > &arg)
 Subtracts arg from this
this -= arg. More...
 
void SubIP (const PMATRIX_TYPE &scalar)
 in place subtraction function More...
 
void Add (const PMATRIX_TYPE &scalar, Matrix< PMATRIX_TYPE > &dest) const
 addition function, storing data destination matrix More...
 
void Sub (const PMATRIX_TYPE &scalar, Matrix< PMATRIX_TYPE > &dest) const
 substraction function, storing data destination matrix More...
 
void MultiplyIP (const PMATRIX_TYPE &scalar)
 in place multiplication function More...
 
void Multiply (const PMATRIX_TYPE &scalar, Matrix< PMATRIX_TYPE > &dest) const
 multiplication function, storing data destination matrix More...
 
void MultLeft (const Matrix< PMATRIX_TYPE > &arg)
 in Place matrix multiplication this is equal to M = arg*M, but faster More...
 
void MultLeft (const Vector< PMATRIX_TYPE > &arg, Vector< PMATRIX_TYPE > &result) const
 vector matrix multiplication result=arg*this. More...
 
void MultiplyWithTransposeOf (const Matrix< PMATRIX_TYPE > &arg, Matrix< PMATRIX_TYPE > &result) const
 matrix matrix multiplication for multiplication with the transpose of the given matrix, result=this*arg^T. More...
 
void DivideIP (const PMATRIX_TYPE &scalar)
 in place division function More...
 
void Divide (const PMATRIX_TYPE &scalar, Matrix< PMATRIX_TYPE > &dest) const
 division function, storing data destination matrix More...
 
void DivideElementwise (const Matrix< PMATRIX_TYPE > &arg)
 elementwise division function in place More...
 
void GetSystemMatrix (Matrix< PMATRIX_TYPE > &dest) const
 compute square system matrix dest = A^T * A More...
 
Get Functions
PMATRIX_TYPE GetMax () const
 Returns the maximum value of the matrix elements. More...
 
PMATRIX_TYPE GetMin () const
 Returns the minimum value of the matrix elements. More...
 
PMATRIX_TYPE * GetData ()
 get the pointer to the data array of the matrix (for faster direct memeory access) More...
 
const PMATRIX_TYPE * GetData () const
 
const PMATRIX_TYPE ** GetDataArray () const
 returns zero based arry for data access More...
 
PMATRIX_TYPE ** GetDataArray ()
 
PMATRIX_TYPE ** GetDataArray1 () const
 returns 1 based array to data access More...
 
unsigned int GetRows () const
 
unsigned int GetCols () const
 
const PMATRIX_TYPE * GetDataLast () const
 Get a pointer to the last data element Do not use this on unitilized matrices with <= on pointers because on an unitilized matrix GetData() will be NULL and last Element < (typically FFFFF8) We don't want an if here for performance reasons of the innerst loop. More...
 
PMATRIX_TYPE * GetDataLast ()
 
Vector< PMATRIX_TYPE > GetRow (const int &row) const
 return a copy of row "row" of this matrix, zero based counting More...
 
Vector< PMATRIX_TYPE > GetCol (const int &col) const
 return a copy of column "col", zero based counting More...
 
void GetSubMatrix (const size_t startRow, const size_t startCol, const size_t numRows, const size_t numCols, Matrix< PMATRIX_TYPE > &submatrix) const
 return a submatrix from this. More...
 
void GetSubMatrix (const Vector< int > &rows, const Vector< int > &cols, Matrix< PMATRIX_TYPE > &submatrix) const
 return a submatrix from this. More...
 
Matrix< PMATRIX_TYPE > GetSubMatrix (const Vector< int > &rows, const Vector< int > &cols) const
 return a submatrix from this. More...
 
void SetSubMatrix (const size_t startRowInThis, const size_t startColInThis, const Matrix< PMATRIX_TYPE > &submatrix, const size_t startRowInSub, const size_t startColInSub, const size_t numRows, const size_t numCols)
 sets a submatrix in this. More...
 
void SetSubMatrix (const size_t startRowInThis, const size_t startColInThis, const Matrix3x3< PMATRIX_TYPE > &submatrix)
 sets a 3x3 submatrix in this. More...
 
void SetSubMatrix (const size_t startRowInThis, const size_t startColInThis, const Vector3< PMATRIX_TYPE > &subvector)
 sets a 3x1 submatrix in this. More...
 
void SetRow (const int row, const Vector< PMATRIX_TYPE > &data)
 set a row of matrix from vector More...
 
void SetCol (const int row, const Vector< PMATRIX_TYPE > &data)
 set a col of matrix from vector More...
 
void Set (const int row, const int col, const Matrix< PMATRIX_TYPE > &data)
 Copies the contents of data into this at the position indicated by row and col. More...
 
void Set (const int row, const int col, const Vector< PMATRIX_TYPE > &data)
 Copies the contents of data into this at the position indicated by row and col. More...
 
void SetTranspose (const int row, const int col, const Vector< PMATRIX_TYPE > &data)
 Copies the contents of data into this at the position indicated by row and col. More...
 
int GetNumElements () const
 Returns the total number of elements. More...
 
void GetMaxMin (PMATRIX_TYPE &max, PMATRIX_TYPE &min) const
 return biggest and smallest entry More...
 
void GetAbsMaxMin (PMATRIX_TYPE &max, PMATRIX_TYPE &min) const
 return biggest and smallest absolute values More...
 
PMATRIX_TYPE GetMean () const
 Returns the mean value of the matrix elements. More...
 
PMATRIX_TYPE NormL1 () const
 Return the L1 norm: |a| + |b| + |c| + ... More...
 
double NormL2 () const
 Return the L2 norm: a^2 + b^2 + c^2 + ... More...
 
double NormFrobenius () const
 Return Frobenius norm = sqrt(trace(A^t * A)). More...
 
PMATRIX_TYPE Trace () const
 
PMATRIX_TYPE DetSquare () const
 
Set Functions
void SetZero ()
 Sets all values to zero. More...
 
void MakeSymmetric ()
 componentwise: this = 0.5(this + this^T) yields symmetric matrix only allowed for square shaped matrices More...
 
void Fill (const PMATRIX_TYPE &scalar)
 Takes the elements of a Vector and put them as diagonal elements into a matrix. More...
 
Scaling and Normalization
void NormalizeColsToOne (const int norm_row_index)
 divides each column of the matrix through the element norm_row_index. More...
 
void NormalizeRowsToOne (const int norm_col_index)
 divides each row of the matrix through the element norm_col_index. More...
 
void NormalizeRows ()
 Normalizes each row to L2 norm one. More...
 
void NormalizeCols ()
 Normalizes each coloumn to L_2 norm one. More...
 
PMATRIX_TYPE Normalize ()
 Normalizes the matrix by the entry with the biggest absolute value by dividing all elements with this one. More...
 
void ScaleRow (int NoRow, PMATRIX_TYPEscale)
 Scales row NoRow with scale. More...
 
void ScaleCol (int NoCol, PMATRIX_TYPEscale)
 Scales column NoCol with scale. More...
 
Input / Output
bool Load (const std::string &filename)
 method to load directly from a given filename. More...
 
bool Save (const std::string &filename) const
 method to save directly to a given filename. More...
 
int WriteMatlab (std::ostream &ostr, const std::string &name) const
 Write the matrix in Matlab format to the given stream. More...
 
bool BinRead (const char *filename) const
 This method reads a matrix from a given file in binary format. More...
 
bool BinWrite (const char *filename) const
 This method writes a matrix to a given file in binary format. More...
 

Protected Member Functions

void copy (const T *v)
 
void destroy ()
 
void initialize (Subscript M, Subscript N)
 
RMatrixBase Parametrization2R_ (const Vector< double > &parametrization, const enum E_ParametrizationType param_type) const
 
void set (const T &val)
 

Protected Attributes

Subscript m_
 
Subscript mn_
 
Subscript n_
 
T ** row_
 
T ** rowm1_
 
T * v_
 
T * vm1_
 

Related Functions

(Note that these are not member functions.)

template<class T >
Matrix< T > operator* (const Matrix< T > &A, const Matrix< T > &B)
 
template<class T >
Vector< T > operator* (const Matrix< T > &A, const Vector< T > &x)
 
template<class T >
Matrix< T > operator+ (const Matrix< T > &A, const Matrix< T > &B)
 
template<class T >
Matrix< T > operator- (const Matrix< T > &A, const Matrix< T > &B)
 
std::ostream & operator<< (std::ostream &s, const Matrix< char > &A)
 
std::ostream & operator<< (std::ostream &s, const Matrix< unsigned char > &A)
 
template<class T >
std::ostream & operator<< (std::ostream &s, const Matrix< T > &A)
 
std::istream & operator>> (std::istream &s, Matrix< unsigned char > &A)
 
std::istream & operator>> (std::istream &s, Matrix< char > &A)
 
template<class T >
std::istream & operator>> (std::istream &s, Matrix< T > &A)
 

Detailed Description

describes a projective 3D -> 2D mapping in homogenous coordinates

Matrix P is a 3x4 matrix (3 rows {Zeilen}, 4 columns{Spalten}) describing a mapping between a 3D projective point in space and the corresponding projective 2D point (in an image plane).

With R' = transpose of R, K = Kamera calibration matrix and C = Kamera center is: P = (K R' | -K R' C) This means that R is the rotation from camera to world coo, and R' = R.Transpose() the rotation from world to camera coo.

Only implementation very specific to PMatrix (and not valid for general matrices, e.g. like decomposition) should be implemented here.

Author
Jan Woetzel alpha (02/26/2002)
Examples:
ExampleEParametrization.cpp, and ExamplePMatrixBase.cpp.

Definition at line 74 of file PMatrixBase.hh.

Member Typedef Documentation

template<class T>
typedef const T* TNT::Matrix< T >::const_iterator
inherited

Definition at line 78 of file cmat.h.

template<class T>
typedef const T& TNT::Matrix< T >::const_reference
inherited

Definition at line 79 of file cmat.h.

template<class T>
typedef T TNT::Matrix< T >::element_type
inherited

Definition at line 74 of file cmat.h.

template<class T>
typedef T* TNT::Matrix< T >::iterator
inherited

Definition at line 76 of file cmat.h.

template<class T>
typedef T* TNT::Matrix< T >::pointer
inherited

Definition at line 75 of file cmat.h.

template<class T>
typedef T& TNT::Matrix< T >::reference
inherited

Definition at line 77 of file cmat.h.

template<class T>
typedef Subscript TNT::Matrix< T >::size_type
inherited

Definition at line 72 of file cmat.h.

template<class T>
typedef T TNT::Matrix< T >::value_type
inherited

Definition at line 73 of file cmat.h.

Member Enumeration Documentation

description of supported parametrization types

Enumerator
AXIS_TIMES_ANGLE 
AXIS_AND_ANGLE 
EULER 
QUATERNION 

Definition at line 166 of file PMatrixBase.hh.

Constructor & Destructor Documentation

BIAS::PMatrixBase::PMatrixBase ( )
inline

default constructor

Definition at line 79 of file PMatrixBase.hh.

BIAS::PMatrixBase::PMatrixBase ( const MatrixInitType i)
inlineexplicit

constructor setting identity or zero

author koeser

Definition at line 84 of file PMatrixBase.hh.

BIAS::PMatrixBase::PMatrixBase ( const std::string &  s)
inlineexplicit

Definition at line 88 of file PMatrixBase.hh.

BIAS::PMatrixBase::PMatrixBase ( const PMatrixBase A)
inline
Author
Jan Woetzel

Definition at line 93 of file PMatrixBase.hh.

BIAS::PMatrixBase::PMatrixBase ( const Matrix3x4< PMATRIX_TYPE > &  Amat_)
inline
Author
Jan Woetzel

Definition at line 97 of file PMatrixBase.hh.

BIAS::PMatrixBase::PMatrixBase ( const Matrix< PMATRIX_TYPE > &  Amat)
inlineexplicit
Author
Jan Woetzel not fine, should no be here, better cast stepwise between direct father and child

Definition at line 218 of file PMatrixBase.hh.

References BIAS::Matrix< PMATRIX_TYPE >::GetData(), BIAS::Matrix< T >::GetData(), TNT::Matrix< T >::num_cols(), and TNT::Matrix< T >::num_rows().

BIAS::PMatrixBase::PMatrixBase ( const Matrix3x3< PMATRIX_TYPE > &  K,
const Matrix3x3< PMATRIX_TYPE > &  R,
const Vector3< PMATRIX_TYPE > &  C 
)
inline

Take R, K, C and compose PMatrixBase.

Author
Jan-Friso Evers-Senne
Date
2002-08-20

Definition at line 201 of file PMatrixBase.hh.

References Compose().

BIAS::PMatrixBase::PMatrixBase ( const Matrix3x3< PMATRIX_TYPE > &  R,
const Vector3< PMATRIX_TYPE > &  C 
)
inline

assume K=Identity and compose P

Author
woelk 08/2004

Definition at line 208 of file PMatrixBase.hh.

References Compose().

virtual BIAS::PMatrixBase::~PMatrixBase ( )
inlinevirtual

destructor

Definition at line 120 of file PMatrixBase.hh.

Member Function Documentation

void BIAS::Matrix< PMATRIX_TYPE >::AbsIP ( )
inherited

absolute values of all elements of the matrix (in place)

Author
bangerer 01/2009
void BIAS::Matrix< PMATRIX_TYPE >::Add ( const PMATRIX_TYPE &  scalar,
Matrix< PMATRIX_TYPE > &  dest 
) const
inlineinherited

addition function, storing data destination matrix

implementation

Author
Ingo Thomsen tested
void BIAS::Matrix< PMATRIX_TYPE >::AddIP ( const PMATRIX_TYPE &  scalar)
inlineinherited

in place addition function

Author
Ingo Thomsen tested

Definition at line 415 of file Matrix.hh.

void BIAS::Matrix< PMATRIX_TYPE >::AddIP ( const Matrix< PMATRIX_TYPE > &  arg)
inlineinherited

Adds arg to this.

Author
grest,2004
Matrix<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::Adjoint ( ) const
inlineinherited

computes the adjoint matrix

Author
Christian Beder
HomgPoint3D PMatrixBase::Backproject ( const HomgPoint2D x,
double  mu = 1 
)

Back projects image point x to 3D space and returns ray on which the 3D space point lies.

Note
Inverted matrix is computed on each call.
Author
jmf

Definition at line 164 of file PMatrixBase.cpp.

References BIAS::HomgPoint3D, and BIAS::Matrix3x3< T >::InvertIP().

bool BIAS::Matrix< PMATRIX_TYPE >::BinRead ( const char *  filename) const
inherited

This method reads a matrix from a given file in binary format.

The file is not human read-/editable but provides full precision. A dimension check is performed.

Returns
true on success
Author
mdunda 04 2004
bool BIAS::Matrix< PMATRIX_TYPE >::BinWrite ( const char *  filename) const
inherited

This method writes a matrix to a given file in binary format.

The file is not human read-/editable but provides full precision.

Returns
true on success
Author
mdunda 04 2004
void BIAS::Matrix3x4< PMATRIX_TYPE >::clear ( )
inlinevirtualinherited

stl conform interface

Reimplemented from BIAS::Matrix< PMATRIX_TYPE >.

Definition at line 149 of file Matrix3x4.hh.

void PMatrixBase::Compose ( const Matrix3x3< PMATRIX_TYPE > &  K,
const Matrix3x3< PMATRIX_TYPE > &  R,
const Vector3< PMATRIX_TYPE > &  C 
)

composes this from K, R and C using P = [ K R' | -K R' C ] with R' = transpose(R)

Author
Felix Woelk

Definition at line 34 of file PMatrixBase.cpp.

References BIAS::Matrix3x3< T >::Mult(), BIAS::Vector3< T >::MultIP(), and BIAS::Matrix3x3< T >::TransposeIP().

Referenced by BIAS::PMatrix::Compose(), PMatrixBase(), BIAS::Covariance3Dto2D::Transform_(), and BIAS::Covariance3Dto2DHomg::Transform_().

void PMatrixBase::Compose ( const Matrix3x3< PMATRIX_TYPE > &  K,
const Matrix3x3< PMATRIX_TYPE > &  R,
const HomgPoint3D C 
)

Definition at line 57 of file PMatrixBase.cpp.

References BIAS::HomgPoint3D::IsAtInfinity(), and BIAS::Vector3< T >::Set().

void PMatrixBase::Compose ( const Matrix3x3< PMATRIX_TYPE > &  R,
const Vector3< PMATRIX_TYPE > &  C 
)

calibrated case, uses K=Identity

Definition at line 70 of file PMatrixBase.cpp.

References BIAS::Matrix3x3< T >::SetIdentity().

void PMatrixBase::Compose ( const Matrix3x3< PMATRIX_TYPE > &  R,
const HomgPoint3D C 
)

calibrated case, uses K=Identity

Definition at line 78 of file PMatrixBase.cpp.

References BIAS::Matrix3x3< T >::SetIdentity().

void PMatrixBase::Compose ( const Matrix3x3< PMATRIX_TYPE > &  K,
const Vector< double > &  parametrization,
const enum E_ParametrizationType  param_type 
)

Compose a projection matrix using a parametrization.

The supported parametrization vector always starts with the camera center followed by the camera orientation. Currently Euler angles, axis (norm 1) and angle, axis times angle and quaternion are supported as orientation parametrization.

Author
woelk 02/2006

Definition at line 86 of file PMatrixBase.cpp.

template<class T>
void TNT::Matrix< T >::copy ( const T *  v)
inlineprotectedinherited
template<class T>
void TNT::Matrix< T >::destroy ( )
inlineprotectedinherited
PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::DetSquare ( ) const
inlineinherited
Author
koeser
Warning
very slow, generic implementation (order "n!"), better to use matrix decomposition (see BIAS/MathAlgo/Lapack.hh)

Definition at line 369 of file Matrix.hh.

template<class T>
Subscript TNT::Matrix< T >::dim ( Subscript  d) const
inlineinherited

Definition at line 310 of file cmat.h.

void BIAS::Matrix< PMATRIX_TYPE >::Divide ( const PMATRIX_TYPE &  scalar,
Matrix< PMATRIX_TYPE > &  dest 
) const
inlineinherited

division function, storing data destination matrix

Author
Ingo Thomsen tested
void BIAS::Matrix< PMATRIX_TYPE >::DivideElementwise ( const Matrix< PMATRIX_TYPE > &  arg)
inlineinherited

elementwise division function in place

Author
Ingo Schiller tested
void BIAS::Matrix< PMATRIX_TYPE >::DivideIP ( const PMATRIX_TYPE &  scalar)
inlineinherited

in place division function

Author
Ingo Thomsen tested

Definition at line 486 of file Matrix.hh.

void BIAS::Matrix< PMATRIX_TYPE >::Fill ( const PMATRIX_TYPE &  scalar)
inherited

Takes the elements of a Vector and put them as diagonal elements into a matrix.

The size of this Vector must be exactly min( matrix.width, matrix.height). Optionally all other elements may be set to zero

Author
Ingo Thomsen
Parameters
zero_othersMust be true, if all non-diagonal elements shall be set to zero
void BIAS::Matrix< PMATRIX_TYPE >::GaussJordan ( )
inherited

use the Gauss Jordan Algrithm to transform the matrix to reduced row echelon form.

Author
woelk 05/2008 www.vision-n.de
void BIAS::Matrix< PMATRIX_TYPE >::GetAbsMaxMin ( PMATRIX_TYPE &  max,
PMATRIX_TYPE &  min 
) const
inherited

return biggest and smallest absolute values

Vector<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::GetCol ( const int &  col) const
inherited

return a copy of column "col", zero based counting

Author
Jan Woetzel
unsigned int BIAS::Matrix< PMATRIX_TYPE >::GetCols ( ) const
inlineinherited

Definition at line 204 of file Matrix.hh.

PMATRIX_TYPE * BIAS::Matrix< PMATRIX_TYPE >::GetData ( )
inlineinherited

get the pointer to the data array of the matrix (for faster direct memeory access)

the order of the data is linewise, which means an elemnt sequence of e.g. [0] = M(0,0) [1] = M(0,1) [2] = M(0,2) [3] = M(1,0) // next line [4] = M(1,1) ...

Author
Jan Woetzel
Returns
a pointer to the data array (beginning with GetData[0]) alpha (02/27/2002) -added const (jw) 03/12/2002
Examples:
ExampleDynamicCastImage.cpp.

Definition at line 185 of file Matrix.hh.

Referenced by BIAS::PMatrix::CheckDecomposition_(), BIAS::PMatrix::CheckSVD_(), PMatrixBase(), set_identity(), BIAS::PMatrix::XMLIn(), and BIAS::PMatrix::XMLOut().

const PMATRIX_TYPE * BIAS::Matrix< PMATRIX_TYPE >::GetData ( ) const
inlineinherited

Definition at line 188 of file Matrix.hh.

const PMATRIX_TYPE ** BIAS::Matrix< PMATRIX_TYPE >::GetDataArray ( ) const
inlineinherited

returns zero based arry for data access

Definition at line 192 of file Matrix.hh.

PMATRIX_TYPE ** BIAS::Matrix< PMATRIX_TYPE >::GetDataArray ( )
inlineinherited

Definition at line 195 of file Matrix.hh.

PMATRIX_TYPE ** BIAS::Matrix< PMATRIX_TYPE >::GetDataArray1 ( ) const
inlineinherited

returns 1 based array to data access

Definition at line 199 of file Matrix.hh.

const PMATRIX_TYPE * BIAS::Matrix< PMATRIX_TYPE >::GetDataLast ( ) const
inlineinherited

Get a pointer to the last data element Do not use this on unitilized matrices with <= on pointers because on an unitilized matrix GetData() will be NULL and last Element < (typically FFFFF8) We don't want an if here for performance reasons of the innerst loop.

Author
Ingo Thomsen, Jan Woetzel
Date
04/11/2002

Definition at line 213 of file Matrix.hh.

PMATRIX_TYPE * BIAS::Matrix< PMATRIX_TYPE >::GetDataLast ( )
inlineinherited

Definition at line 219 of file Matrix.hh.

Matrix<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::GetMax ( Matrix< PMATRIX_TYPE > &  m)
inherited

returns an matrix the same size as the matrix n and m with the largest elements taken from n or m

Author
bangerer 01/2009
PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::GetMax ( ) const
inherited

Returns the maximum value of the matrix elements.

Author
Ingo Thomsen
Date
04/11/2002 tested
void BIAS::Matrix< PMATRIX_TYPE >::GetMaxMin ( PMATRIX_TYPE &  max,
PMATRIX_TYPE &  min 
) const
inherited

return biggest and smallest entry

PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::GetMean ( void  ) const
inherited

Returns the mean value of the matrix elements.

Author
Ingo Thomsen
Date
04/11/2002 tested
Matrix<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::GetMin ( Matrix< PMATRIX_TYPE > &  m)
inherited

returns an matrix the same size as the matrix n and m with the smallest elements taken from n or m

Author
bangerer 01/2009
PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::GetMin ( ) const
inherited

Returns the minimum value of the matrix elements.

Author
Ingo Thomsen
Date
04/11/2002 tested
int BIAS::Matrix< PMATRIX_TYPE >::GetNumElements ( ) const
inlineinherited

Returns the total number of elements.

Author
Ingo Thomsen
Date
04/11/2002 tested

Definition at line 321 of file Matrix.hh.

Vector<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::GetRow ( const int &  row) const
inherited

return a copy of row "row" of this matrix, zero based counting

Author
Jan Woetzel
unsigned int BIAS::Matrix< PMATRIX_TYPE >::GetRows ( ) const
inlineinherited

Definition at line 202 of file Matrix.hh.

void BIAS::Matrix< PMATRIX_TYPE >::GetSubMatrix ( const size_t  startRow,
const size_t  startCol,
const size_t  numRows,
const size_t  numCols,
Matrix< PMATRIX_TYPE > &  submatrix 
) const
inherited

return a submatrix from this.

Start index is [startRow][startCol] end index is [startRow+numRows-1][startCol+numCols-1]. submatrix is resized to numRows/numCols if necessary.

Author
apetersen 12/2010
void BIAS::Matrix< PMATRIX_TYPE >::GetSubMatrix ( const Vector< int > &  rows,
const Vector< int > &  cols,
Matrix< PMATRIX_TYPE > &  submatrix 
) const
inherited

return a submatrix from this.

Similar to matlab notation (except indexing, starts with 0 of course!). Vectors rows = '1 3' and cols = '1 2' for matrix: / 1 2 3 \ | 4 5 6 | \ 7 8 9 / results in: / 1 2 \ \ 7 8 / Matrix has to be initialized!!!

Author
apetersen 7/2011
Matrix<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::GetSubMatrix ( const Vector< int > &  rows,
const Vector< int > &  cols 
) const
inherited

return a submatrix from this.

Similar to matlab notation (except indexing, starts with 0 of course!), see GetSubMatrix(const Vector<int> &rows, const Vector<int> &cols, Matrix<T> &submatrix)

Author
apetersen 7/2011
void BIAS::Matrix< PMATRIX_TYPE >::GetSystemMatrix ( Matrix< PMATRIX_TYPE > &  dest) const
inlineinherited

compute square system matrix dest = A^T * A

Parameters
destholds result of this->Transpose * this

If you want to solve A * x = b, where A has more rows than columns, a common technique is to solve x = (A^T * A)^-1 * A^T * b. This function provides a fast way to compute A^T*A from A.

Author
grest/koeser
template<class T>
void TNT::Matrix< T >::initialize ( Subscript  M,
Subscript  N 
)
inlineprotectedinherited
template<class T>
TNT::Matrix< T >::initialize ( ,
 
)
inherited
bool BIAS::Matrix< PMATRIX_TYPE >::IsIdentity ( double  eps = 0.0) const
inherited

Checks if the matrix a an identity.

I.e. all elements with index i==j are equal 1 and all others are zero.

Author
mdunda 12 2003
Returns
true if matrix is identity
bool BIAS::Matrix< PMATRIX_TYPE >::IsZero ( double  eps = 0.0) const
inherited

Checks if the matrix is a null matrix.

Author
mdunda 12 2003
Returns
true if all elements are zero
void BIAS::Matrix< PMATRIX_TYPE >::Kronecker ( Matrix< PMATRIX_TYPE > const  B,
Matrix< PMATRIX_TYPE > &  dest 
) const
inherited

Kronecker-product with matrix, result in dest.

Kronecker-product with matrix B, result in dest.

template<class T>
Subscript TNT::Matrix< T >::lbound ( ) const
inlineinherited

Definition at line 81 of file cmat.h.

bool BIAS::Matrix< PMATRIX_TYPE >::Load ( const std::string &  filename)
inherited

method to load directly from a given filename.

internally using stream operator

Author
Jan Woetzel 05/2003
Returns
false in case of error, true in case of success

Referenced by BIAS::PMatrix::Load().

int BIAS::Matrix3x4< PMATRIX_TYPE >::LoadBan ( const std::string &  filename,
const unsigned int &  Time = 0 
)
inherited

Loads a PMatrix from .ban file given by AddCameraKey and Time index.

Returns
0 in case of success and negative nr. in case of error.
Author
Jan Woetzel
int PMatrixBase::LoadBOG ( const std::string &  filename)

Load a Daimler .bog fiel and compose a P matrix from it.

Author
Jan Woetzel 03/2005
Examples:
ExampleLoadBOG_P.cpp.

Definition at line 193 of file PMatrixBase.cpp.

References BIAS::LoadBogK(), BIAS::LoadBogRC(), and BIAS::Vector3< T >::LoadBogTC().

int BIAS::Matrix3x4< PMATRIX_TYPE >::LoadPARTXT ( const std::string &  filenameParTxt,
const unsigned int &  index,
std::string &  correspImgFilename,
int &  nTotal 
)
inherited

Load a PMatrix from a _par.txt (S.

Seitz' format)

Useful to load camera parameters of S. Seitz' sequences, e.g. temple Ring "templeR_par.txt". The file format is: There is one line for each image. The format for each line is: "imgname.png k11 k12 k13 k21 k22 k23 k31 k32 k33 r11 r12 r13 r21 r22 r23 r31 r32 r33 t1 t2 t3" The Seitz' projection matrix representation is given by K*[R t] in contrast to BIAS::PMatrix semantics. However, we convert into our 3x4 PMatrix representation on Load internally.

Parameters
filenameParTxtinput xxx_par.txt file in Steven Seitz' format with linewise camparams
indexdesired image nr.
correspImgFilenamecorresponding "original" image filename
nTotaltotal number of cameras for that sequence, given at beginning of file.
Author
Jan Woetzel, Marc Grauel
void BIAS::Matrix< PMATRIX_TYPE >::MakeSymmetric ( )
inlineinherited

componentwise: this = 0.5(this + this^T) yields symmetric matrix only allowed for square shaped matrices

Author
koeser 01/2007

Definition at line 522 of file Matrix.hh.

void BIAS::Matrix3x4< PMATRIX_TYPE >::Mult ( const Vector4< PMATRIX_TYPE > &  argvec,
Vector3< PMATRIX_TYPE > &  destvec 
) const
inlineinherited

matrix - vector multiplicate this matrix with Vector4, storing the result in destvec calculates: destvec = (this Matrix) * argvec

Author
Jan Woetzel untested (04/17/2002)
void BIAS::Matrix3x4< PMATRIX_TYPE >::Mult ( const Matrix4x4< PMATRIX_TYPE > &  argmat,
Matrix3x4< PMATRIX_TYPE > &  destmat 
) const
inlineinherited

matrix-matrix multiplication with Matrix4x4 storing the result in destmat

Definition at line 155 of file Matrix3x4.hh.

References BIAS::Matrix< T >::GetData().

void BIAS::Matrix< PMATRIX_TYPE >::Mult ( const Matrix< PMATRIX_TYPE > &  arg,
Matrix< PMATRIX_TYPE > &  result 
) const
inlineinherited

matrix multiplication, result is not allocated

Author
Felix Woelk
void BIAS::Matrix< PMATRIX_TYPE >::Mult ( const Matrix< PMATRIX_TYPE > &  arg)
inlineinherited

in Place matrix multiplication this is equal to M = M * arg, but faster

Author
Daniel Grest
void BIAS::Matrix< PMATRIX_TYPE >::Mult ( const Vector< PMATRIX_TYPE > &  arg,
Vector< PMATRIX_TYPE > &  result 
) const
inlineinherited

matrix vector multiplication, result is not allocated

Author
Felix Woelk
void BIAS::Matrix< PMATRIX_TYPE >::Multiply ( const PMATRIX_TYPE &  scalar,
Matrix< PMATRIX_TYPE > &  dest 
) const
inlineinherited

multiplication function, storing data destination matrix

Author
Ingo Thomsen tested
void BIAS::Matrix< PMATRIX_TYPE >::MultiplyIP ( const PMATRIX_TYPE &  scalar)
inlineinherited

in place multiplication function

Author
Ingo Thomsen tested

Definition at line 448 of file Matrix.hh.

Referenced by BIAS::PMatrix::Normalize().

void BIAS::Matrix< PMATRIX_TYPE >::MultiplyWithTransposeOf ( const Matrix< PMATRIX_TYPE > &  arg,
Matrix< PMATRIX_TYPE > &  result 
) const
inlineinherited

matrix matrix multiplication for multiplication with the transpose of the given matrix, result=this*arg^T.

Author
Arne Petersen
void BIAS::Matrix< PMATRIX_TYPE >::MultLeft ( const Matrix< PMATRIX_TYPE > &  arg)
inlineinherited

in Place matrix multiplication this is equal to M = arg*M, but faster

Author
Daniel Grest
void BIAS::Matrix< PMATRIX_TYPE >::MultLeft ( const Vector< PMATRIX_TYPE > &  arg,
Vector< PMATRIX_TYPE > &  result 
) const
inlineinherited

vector matrix multiplication result=arg*this.

Author
Marcel Lilienthal
PMatrixBase & PMatrixBase::newsize ( int  rows,
int  cols 
)

setting a new size different from 3x4 is not allowed for the fixed size P-Matrix overloads the general newsize from basec class

Author
Jan Woetzel alpha (02/25/2002)

Definition at line 146 of file PMatrixBase.cpp.

template<class T>
Matrix<T>& TNT::Matrix< T >::newsize ( Subscript  M,
Subscript  N 
)
inlineinherited
Examples:
EvaluateAlignment.cpp, ExampleAlignment.cpp, ExampleIEKF.cpp, ExampleLeastSquares.cpp, ExampleRegressionPlane.cpp, and ExampleUncertaintyTransform.cpp.

Definition at line 269 of file cmat.h.

Referenced by BIAS::Matrix< T >::Add(), BIAS::RegionMatcher::BilinearRegion(), BIAS::RegionMatcher::BilinearRegionColor3(), BIAS::ComputeCovariance(), BIAS::LDA::ComputeReductionMatrix(), BIAS::PCA::ComputeReductionMatrix(), BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix(), BIAS::ContourBSplineData::ComputeSplineMetricMatrix_(), BIAS::Matrix< T >::Conv(), BIAS::CamPoseCalib::CreateSecDMatrix_(), BIAS::Matrix< T >::Divide(), Eigenproblem_quadratic_matrix(), BIAS::CamPoseCalib::Estimate(), BIAS::TrackerBaseAffine< StorageType >::EvaluateResult_(), BIAS::TrackerBaseAffine2< StorageType >::EvaluateResult_(), BIAS::TrackerBaseInterface< StorageType >::EvaluateResult_(), BIAS::TrackerBaseInterface< StorageType >::Filter_ByMask(), BIAS::TrackerBaseInterface< StorageType >::Filter_BySeparableMask(), BIAS::TrackerBaseInterface< StorageType >::Filter_GradXSobel3x3(), BIAS::TrackerBaseInterface< StorageType >::Filter_GradYSobel3x3(), BIAS::TrackerBaseInterface< StorageType >::FilterLowpass_Binomial3x3(), BIAS::TrackerBaseInterface< StorageType >::FilterLowpass_ByMask(), BIAS::TrackerBaseInterface< StorageType >::FilterLowpass_BySeparableMask(), Fortran_Matrix_to_Matrix(), generalised_eigenvalue_matrix_solve(), BIAS::LDA::GenerateRandomTestData(), BIAS::SparseMatrix::GetAsDense(), BIAS::Random::GetMeanAndCovariance(), BIAS::PMatrixLinear::GetPEstSystemHom(), BIAS::PMatrixLinear::GetPEstSystemInHom(), BIAS::Matrix< T >::GetSystemMatrix(), BIAS::Kalman::Init(), BIAS::IteratedExtendedKalman::Init(), BIAS::SparseMatrix::Invert(), BIAS::SparseMatrix::InvertAndSolve(), BIAS::Matrix< T >::Kronecker(), Lapack_Cholesky_SymmetricPositiveDefinit(), BIAS::RegionMatcher::LinearRegionX(), BIAS::LevenbergMarquardtBase::LM_Compute(), BIAS::LevenbergMarquardtBase::LM_ComputeWithoutJacobian(), TNT::matmult(), BIAS::Matrix< T >::Mult(), BIAS::Matrix< T >::Multiply(), BIAS::Matrix< T >::MultiplyWithTransposeOf(), BIAS::MxArrToBIASMatrix(), BIAS::Matrix3x4< T >::newsize(), BIAS::Matrix4x4< T >::newsize(), BIAS::TextureTransformHomography::ParameterInversionJacobian(), BIAS::TextureTransformAffine::ParameterInversionJacobian(), BIAS::TextureTransformDisparity::ParameterInversionJacobian(), BIAS::TextureTransformDisplacement::ParameterInversionJacobian(), BIAS::TextureTransformRotation::ParameterInversionJacobian(), BIAS::TextureTransformEuclidian::ParameterInversionJacobian(), BIAS::TextureTransformAffine::ParameterJacobianBackward(), BIAS::TextureTransformHomography::ParameterJacobianBackward(), BIAS::TextureTransformDisparity::ParameterJacobianBackward(), BIAS::TextureTransformDisplacement::ParameterJacobianBackward(), BIAS::TextureTransformRotation::ParameterJacobianBackward(), BIAS::TextureTransformEuclidian::ParameterJacobianBackward(), BIAS::TextureTransformSimilar::ParameterJacobianBackward(), BIAS::TextureTransform::ParameterJacobianBackward(), BIAS::TextureTransformAffine::ParameterJacobianForward(), BIAS::TextureTransformHomography::ParameterJacobianForward(), BIAS::TextureTransformDisparity::ParameterJacobianForward(), BIAS::TextureTransformDisplacement::ParameterJacobianForward(), BIAS::TextureTransformRotation::ParameterJacobianForward(), BIAS::TextureTransformEuclidian::ParameterJacobianForward(), BIAS::TextureTransformSimilar::ParameterJacobianForward(), BIAS::TextureTransform::ParameterJacobianForward(), BIAS::IteratedExtendedKalman::Predict(), BIAS::Covariance3Dto2D::Project(), BIAS::Covariance3Dto2DHomg::Project(), BIAS::QRFrac(), BIAS::RegionMatcher::RegionMatcher(), BIAS::ContourBSplineShapeMatrix::SetShapeSpaceEuclidian(), BIAS::ContourBSplineShapeMatrix::SetShapeSpaceIdentity(), BIAS::ContourBSplineShapeMatrix::SetShapeSpaceMatrix(), BIAS::ContourBSplineShapeMatrix::SetShapeSpacePlanarAffin(), BIAS::ContourBSplineShapeMatrix::SetSubShapeSpaceZero(), BIAS::Matrix< T >::Sub(), BIAS::TrackerBaseAffine< StorageType >::TrackAffine_(), BIAS::MonteCarloTransform::Transform(), BIAS::UnscentedTransform::Transform(), BIAS::IteratedExtendedKalman::Update(), and BIAS::Tracker< StorageType, CalculationType >::Vector2FilterMask_().

PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::Normalize ( )
inherited

Normalizes the matrix by the entry with the biggest absolute value by dividing all elements with this one.

Returns
value of the element the matrix is normalized with
Author
mdunda 09 2003
void BIAS::Matrix< PMATRIX_TYPE >::NormalizeCols ( )
inherited

Normalizes each coloumn to L_2 norm one.

Attention each column is normaized by its own scale!

void BIAS::Matrix< PMATRIX_TYPE >::NormalizeColsToOne ( const int  norm_row_index)
inherited

divides each column of the matrix through the element norm_row_index.

index runs [0..num_rows-1] for example: 2 3 4 5 normalized with row '1' will be 2/4 3/5 1 1

void BIAS::Matrix< PMATRIX_TYPE >::NormalizeRows ( )
inherited

Normalizes each row to L2 norm one.

Attention each row is normaized by its own scale!

void BIAS::Matrix< PMATRIX_TYPE >::NormalizeRowsToOne ( const int  norm_col_index)
inherited

divides each row of the matrix through the element norm_col_index.

index runs [0..num_cols-1] for example: 2 3 4 5 normalized with row '1' will be 2/3 1 4/5 1

double BIAS::Matrix< PMATRIX_TYPE >::NormFrobenius ( ) const
inlineinherited

Return Frobenius norm = sqrt(trace(A^t * A)).

this method is deprecated because it is equivalent to NormL2

This function is deprecated, because it is equivalent to NormL2.

Author
koeser 02/2004
PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::NormL1 ( ) const
inlineinherited

Return the L1 norm: |a| + |b| + |c| + ...

Author
Ingo Thomsen
Date
04/11/2002 untested
double BIAS::Matrix< PMATRIX_TYPE >::NormL2 ( ) const
inlineinherited

Return the L2 norm: a^2 + b^2 + c^2 + ...

Author
woelk 07/2004
template<class T>
Subscript TNT::Matrix< T >::num_cols ( ) const
inlineinherited
Examples:
ExampleGenerateGauss.cpp.

Definition at line 320 of file cmat.h.

Referenced by BIAS::Matrix< T >::Add(), BIAS::Matrix< T >::AddIP(), BIAS::ImageAlignment::Align(), BIAS::CamPoseCalib::ApplyCoVariances_(), BIAS::ImageAlignment::AutoAlign(), BIAS::TFTensorEstimation::Compute(), BIAS::SVD3x3::Compute(), BIAS::GaussHelmert::ComputeNormalSystem_(), BIAS::LDA::ComputeReductionMatrix(), BIAS::PCA::ComputeReductionMatrix(), BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix(), BIAS::PCA::ComputeScatter(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::LDA::ComputeWithinAndInterClassCovs(), BIAS::Matrix< T >::Conv(), BIAS::Matrix< T >::Divide(), BIAS::Matrix< T >::DivideElementwise(), Eigenproblem_quadratic_matrix(), Eigenvalue_solve(), BIAS::CamPoseCalib::Estimate(), Fortran_Matrix_to_Matrix(), General_singular_value_decomposition(), generalised_eigenvalue_matrix_solve(), BIAS::CamPoseCalib::GetCov(), BIAS::CamPoseCalib::GetCoVarMatrix(), BIAS::SVD::GetNullvector(), BIAS::Matrix< T >::Kronecker(), Lapack_Cholesky_SymmetricPositiveDefinit(), Lapack_LLS_QR_linear_solve(), Lapack_LU_linear_solve(), Lapack_WLLS_solve(), TNT::matmult(), BIAS::Matrix2x2< T >::Matrix2x2(), BIAS::Matrix3x3< T >::Matrix3x3(), BIAS::Matrix4x4< T >::Matrix4x4(), BIAS::Matrix< T >::Mult(), TNT::mult_element(), BIAS::Matrix< T >::Multiply(), BIAS::Matrix< T >::MultiplyWithTransposeOf(), TNT::Matrix< BIAS::BIAS::Vector< int > >::newsize(), BIAS::TrackerBaseInterface< StorageType >::NormalizeRegion_(), BIAS::Vector< T >::operator*(), BIAS::Vector3< T >::operator*(), BIAS::Vector4< T >::operator*(), TNT::Matrix< T >::operator+(), TNT::Matrix< T >::operator-(), BIAS::Matrix3x4< T >::operator=(), BIAS::Matrix4x4< T >::operator=(), BIAS::PMatrix::PMatrix(), PMatrixBase(), BIAS::CovTransformPose::PoseEulerZYXToQuat(), BIAS::CovTransformPose::PoseQuatToEulerZYX(), BIAS::IteratedExtendedKalman::Predict(), BIAS::Covariance3Dto2DHomg::Project(), BIAS::RMatrix::RMatrix(), BIAS::RMatrixBase::RMatrixBase(), BIAS::Matrix< T >::Set(), BIAS::RParametrization::SetCovarianceMatrix(), BIAS::PoseParametrization::SetCovarianceMatrix(), BIAS::EParametrization::SetCovarianceMatrix(), BIAS::LocalAffineFrame::SetFromMatrix(), BIAS::IteratedExtendedKalman::SetProcessCov(), BIAS::ContourBSplineShapeMatrix::SetShapeSpaceMatrix(), BIAS::IteratedExtendedKalman::SetState(), BIAS::ContourBSplineShapeMatrix::SetSubShapeSpaceZero(), BIAS::GaussHelmert::Solve(), BIAS::LeastSquaresSVD::Solve(), BIAS::SVD::Solve(), BIAS::CamPoseCalib::SolveLM_(), BIAS::ImageAlignment::StrictPyramidAlign(), BIAS::Matrix< T >::Sub(), BIAS::Matrix< T >::SubIP(), BIAS::SymmetricMatrix3x3< T >::SymmetricMatrix3x3(), BIAS::TrackerBaseAffine< StorageType >::TrackAffine_(), BIAS::MonteCarloTransform::Transform(), BIAS::UnscentedTransform::Transform(), BIAS::CovTransformPose::TransformPoint3D(), BIAS::CovTransformPose::TransformPose(), TNT::transpose(), BIAS::Kalman::Update(), BIAS::IteratedExtendedKalman::Update(), and Upper_symmetric_eigenvalue_solve().

template<class T>
Subscript TNT::Matrix< T >::num_rows ( ) const
inlineinherited
Examples:
ExampleGenerateGauss.cpp.

Definition at line 319 of file cmat.h.

Referenced by BIAS::Matrix< T >::Add(), BIAS::Matrix< T >::AddIP(), BIAS::ImageAlignment::Align(), BIAS::ImageAlignment::AutoAlign(), BIAS::SVD3x3::Compute(), BIAS::ImageBlender::ComputeCylCamGeometry(), BIAS::ImageBlenderIncremental::ComputeCylCamGeometry_(), BIAS::LDA::ComputeReductionMatrix(), BIAS::PCA::ComputeReductionMatrix(), BIAS::ContourBSplineShapeMatrix::ComputeRegularisationMatrix(), BIAS::PCA::ComputeScatter(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::LDA::ComputeWithinAndInterClassCovs(), BIAS::Matrix< T >::Conv(), BIAS::Matrix< T >::Divide(), BIAS::Matrix< T >::DivideElementwise(), Eigenproblem_quadratic_matrix(), Eigenvalue_solve(), BIAS::CamPoseCalib::Estimate(), Fortran_Matrix_to_Matrix(), General_singular_value_decomposition(), generalised_eigenvalue_matrix_solve(), BIAS::CamPoseCalib::GetCov(), BIAS::CamPoseCalib::GetCoVarMatrix(), BIAS::SVD::GetLeftNullvector(), BIAS::Kalman::Init(), BIAS::IteratedExtendedKalman::Init(), BIAS::Matrix< T >::Kronecker(), Lapack_Cholesky_SymmetricPositiveDefinit(), Lapack_LLS_QR_linear_solve(), Lapack_LU_linear_solve(), Lapack_WLLS_solve(), TNT::matmult(), BIAS::Matrix2x2< T >::Matrix2x2(), BIAS::Matrix3x3< T >::Matrix3x3(), BIAS::Matrix4x4< T >::Matrix4x4(), BIAS::Matrix< T >::Mult(), TNT::mult_element(), BIAS::Matrix< T >::Multiply(), BIAS::Matrix< T >::MultiplyWithTransposeOf(), BIAS::Matrix< T >::MultLeft(), TNT::Matrix< BIAS::BIAS::Vector< int > >::newsize(), BIAS::TrackerBaseInterface< StorageType >::NormalizeRegion_(), BIAS::Vector< T >::operator*(), BIAS::Vector3< T >::operator*(), BIAS::Vector4< T >::operator*(), TNT::Matrix< T >::operator+(), TNT::Matrix< T >::operator-(), BIAS::Matrix3x4< T >::operator=(), BIAS::Matrix4x4< T >::operator=(), BIAS::PMatrix::PMatrix(), PMatrixBase(), BIAS::CovTransformPose::PoseEulerZYXToQuat(), BIAS::CovTransformPose::PoseQuatToEulerZYX(), BIAS::IteratedExtendedKalman::Predict(), BIAS::RMatrix::RMatrix(), BIAS::RMatrixBase::RMatrixBase(), BIAS::Matrix< T >::Set(), BIAS::RParametrization::SetCovarianceMatrix(), BIAS::PoseParametrization::SetCovarianceMatrix(), BIAS::EParametrization::SetCovarianceMatrix(), BIAS::LocalAffineFrame::SetFromMatrix(), BIAS::IteratedExtendedKalman::SetProcessCov(), BIAS::ContourBSplineShapeMatrix::SetShapeSpaceMatrix(), BIAS::IteratedExtendedKalman::SetState(), BIAS::ContourBSplineShapeMatrix::SetSubShapeSpaceZero(), BIAS::GaussHelmert::Solve(), BIAS::LeastSquaresSVD::Solve(), BIAS::SVD::Solve(), BIAS::CamPoseCalib::SolveLM_(), SquaredMahalanobisDistance(), BIAS::ImageAlignment::StrictPyramidAlign(), BIAS::Matrix< T >::Sub(), BIAS::Matrix< T >::SubIP(), BIAS::SymmetricMatrix3x3< T >::SymmetricMatrix3x3(), BIAS::TrackerBaseAffine2< StorageType >::TrackAffine_(), BIAS::MonteCarloTransform::Transform(), BIAS::UnscentedTransform::Transform(), BIAS::CovTransformPose::TransformPoint3D(), BIAS::CovTransformPose::TransformPose(), TNT::transpose(), BIAS::Kalman::Update(), BIAS::IteratedExtendedKalman::Update(), Upper_symmetric_eigenvalue_solve(), and BIAS::LeastSquaresLapack::WeightedSolve().

template<class T>
reference TNT::Matrix< T >::operator() ( Subscript  i)
inlineinherited

Definition at line 343 of file cmat.h.

template<class T>
const_reference TNT::Matrix< T >::operator() ( Subscript  i) const
inlineinherited

Definition at line 352 of file cmat.h.

template<class T>
reference TNT::Matrix< T >::operator() ( Subscript  i,
Subscript  j 
)
inlineinherited

Definition at line 363 of file cmat.h.

template<class T>
const_reference TNT::Matrix< T >::operator() ( Subscript  i,
Subscript  j 
) const
inlineinherited

Definition at line 376 of file cmat.h.

PMatrixBase & BIAS::PMatrixBase::operator= ( const PMatrixBase mat)
inline

Definition at line 233 of file PMatrixBase.hh.

References BIAS::Matrix< T >::operator=().

Referenced by BIAS::PMatrix::operator=().

template<class T>
T* TNT::Matrix< T >::operator[] ( Subscript  i)
inlineinherited

Definition at line 325 of file cmat.h.

template<class T>
const T* TNT::Matrix< T >::operator[] ( Subscript  i) const
inlineinherited

Definition at line 334 of file cmat.h.

RMatrixBase PMatrixBase::Parametrization2R_ ( const Vector< double > &  parametrization,
const enum E_ParametrizationType  param_type 
) const
protected
template<class T>
std::ostream& TNT::Matrix< T >::Print ( std::ostream &  s,
const int  width,
const int  precision,
bool  scientific = true 
) const
inlineinherited
Author
Ingo Schiller
Examples:
ExampleSparseMatrix.cpp.
template<class T>
std::ostream& TNT::Matrix< T >::Print ( std::ostream &  s,
const bool  intCastOutput = false,
const bool  binaryOutput = false,
const bool  forceFullPrecision = false 
) const
inlineinherited
Author
Jan Woetzel
template<class T>
std::ostream& TNT::Matrix< T >::PrintPretty ( std::ostream &  s,
const std::string &  name = "",
const int  width = 8,
const bool  alignLeft = true 
) const
inlineinherited
Author
Sandro Esquivel
Examples:
ExampleSVD.cpp, and ExampleSVD3x3.cpp.
template<class T >
std::istream & TNT::Matrix< T >::Read ( std::istream &  s,
const bool  intCastInput = false,
const bool  binaryInput = false 
)
inlineinherited

JW.

Author
Jan Woetzel

Definition at line 605 of file cmat.h.

Referenced by TNT::Matrix< T >::operator>>().

bool BIAS::Matrix< PMATRIX_TYPE >::Save ( const std::string &  filename) const
inherited

method to save directly to a given filename.

internally using stream operator

Author
Jan Woetzel 05/2003
Returns
false in case of error, true in case of success
void BIAS::Matrix< PMATRIX_TYPE >::ScaleCol ( int  NoCol,
PMATRIX_TYPE  scale 
)
inherited

Scales column NoCol with scale.

void BIAS::Matrix< PMATRIX_TYPE >::ScaleRow ( int  NoRow,
PMATRIX_TYPE  scale 
)
inherited

Scales row NoRow with scale.

template<class T>
void TNT::Matrix< T >::set ( const T &  val)
inlineprotectedinherited

Definition at line 152 of file cmat.h.

Referenced by TNT::Matrix< BIAS::BIAS::Vector< int > >::operator=().

template<class T>
TNT::Matrix< T >::set ( value  )
inherited
void BIAS::Matrix< PMATRIX_TYPE >::Set ( const int  row,
const int  col,
const Matrix< PMATRIX_TYPE > &  data 
)
inherited

Copies the contents of data into this at the position indicated by row and col.

The size of *this must be big enought to carry data

Author
woelk 05/2008 (c) www.vision-n.de
void BIAS::Matrix< PMATRIX_TYPE >::Set ( const int  row,
const int  col,
const Vector< PMATRIX_TYPE > &  data 
)
inherited

Copies the contents of data into this at the position indicated by row and col.

The size of *this must be big enought to carry data. Data i interpreted as column vector

Author
woelk 05/2008 (c) www.vision-n.de
void BIAS::PMatrixBase::set_identity ( )
inline

Convert the PMatrixBase to 'identity' matrix, overriding the Matrix3x4 method: 1 0 0 0 0 1 0 0 0 0 1 0.

Author
Ingo Thomsen
Date
04/11/2002 tested
Examples:
PMatrixTest.cpp.

Definition at line 212 of file PMatrixBase.hh.

References BIAS::Matrix< PMATRIX_TYPE >::GetData().

Referenced by BIAS::PMatrixEstimation::InitP1P2Trans().

void BIAS::Matrix< PMATRIX_TYPE >::SetCol ( const int  row,
const Vector< PMATRIX_TYPE > &  data 
)
inherited

set a col of matrix from vector

Author
woelk 08/2004
void PMatrixBase::SetFromVector ( const Vector< PMATRIX_TYPE > &  vals)

Sets P-Matrix from a vector which contains the elements of P row wise.

Definition at line 156 of file PMatrixBase.cpp.

References BIAS::Vector< T >::GetData().

Referenced by BIAS::PMatrixLinear::Compute().

void BIAS::Matrix3x4< PMATRIX_TYPE >::SetIdentity ( )
inlineinherited

set the elements of this matrix to the matrix 1 0 0 0 0 1 0 0 0 0 1 0 which is no strict identity (!)

Author
Jan Woetzel
Date
04/17/2002 untested
Examples:
ExampleConic.cpp, ExampleFMatrix.cpp, ExamplePMatrix.cpp, and ExampleThreeDOutVRML.cpp.
void BIAS::Matrix< PMATRIX_TYPE >::SetRow ( const int  row,
const Vector< PMATRIX_TYPE > &  data 
)
inherited

set a row of matrix from vector

Author
woelk 08/2004
void BIAS::Matrix< PMATRIX_TYPE >::SetSubMatrix ( const size_t  startRowInThis,
const size_t  startColInThis,
const Matrix< PMATRIX_TYPE > &  submatrix,
const size_t  startRowInSub,
const size_t  startColInSub,
const size_t  numRows,
const size_t  numCols 
)
inherited

sets a submatrix in this.

Start index in this is [startRowInThis][startColInThis] end index is [startRowInThis+numRows-1][startColInThis+numCols-1]. Entries copyed from submatrix beginning at [startRowInSub][startColInSub] and stop at [startRowInSub+numRows-1][startColInSub+numCols-1]

Author
apetersen 12/2010
void BIAS::Matrix< PMATRIX_TYPE >::SetSubMatrix ( const size_t  startRowInThis,
const size_t  startColInThis,
const Matrix3x3< PMATRIX_TYPE > &  submatrix 
)
inherited

sets a 3x3 submatrix in this.

Start index in this is [startRowInThis][startColInThis] end index is [startRowInThis+2][startColInThis+2].

Author
apetersen 12/2010
void BIAS::Matrix< PMATRIX_TYPE >::SetSubMatrix ( const size_t  startRowInThis,
const size_t  startColInThis,
const Vector3< PMATRIX_TYPE > &  subvector 
)
inherited

sets a 3x1 submatrix in this.

Start index in this is [startRowInThis][startColInThis] end index is [startRowInThis+2][startColInThis].

Author
apetersen 12/2010
void BIAS::Matrix< PMATRIX_TYPE >::SetTranspose ( const int  row,
const int  col,
const Vector< PMATRIX_TYPE > &  data 
)
inherited

Copies the contents of data into this at the position indicated by row and col.

The size of *this must be big enought to carry data. Data is interpreted as row vector.

Author
woelk 05/2008 (c) www.vision-n.de
void BIAS::Matrix< PMATRIX_TYPE >::SetZero ( )
inlineinherited

Sets all values to zero.

Author
Ingo Thomsen, JW
Date
04/11/2002 tested
Examples:
ExamplePMatrix.cpp.
template<class T>
Subscript TNT::Matrix< T >::size ( ) const
inlineinherited
void BIAS::Matrix< PMATRIX_TYPE >::Sub ( const PMATRIX_TYPE &  scalar,
Matrix< PMATRIX_TYPE > &  dest 
) const
inlineinherited

substraction function, storing data destination matrix

Author
Ingo Thomsen tested
void BIAS::Matrix< PMATRIX_TYPE >::SubIP ( const Matrix< PMATRIX_TYPE > &  arg)
inlineinherited

Subtracts arg from this
this -= arg.

Author
grest, 2004
void BIAS::Matrix< PMATRIX_TYPE >::SubIP ( const PMATRIX_TYPE &  scalar)
inlineinherited

in place subtraction function

Author
Ingo Thomsen tested

Definition at line 437 of file Matrix.hh.

void BIAS::Matrix< PMATRIX_TYPE >::SwapRows ( const int  i,
const int  r 
)
inherited

swaps two rows

Author
woelk 05/2008 www.vision-n.de
PMATRIX_TYPE BIAS::Matrix< PMATRIX_TYPE >::Trace ( ) const
inlineinherited
Author
koeser
Matrix<PMATRIX_TYPE > BIAS::Matrix< PMATRIX_TYPE >::Transpose ( ) const
inlineinherited

transpose function, storing data destination matrix

Author
JMF
void BIAS::Matrix< PMATRIX_TYPE >::Vec ( Vector< PMATRIX_TYPE > &  dest) const
inherited

vec-operator returns the elements of the matrix columwise as vector

vec-operator returns the elements of the matrix columnwise as vector

int BIAS::Matrix< PMATRIX_TYPE >::WriteMatlab ( std::ostream &  ostr,
const std::string &  name 
) const
inherited

Write the matrix in Matlab format to the given stream.

Parameters
nameIs the name of the Matlab variable
Author
streckel 08/2006
Returns
negativev if error

Friends And Related Function Documentation

template<class T >
Matrix< T > operator* ( const Matrix< T > &  A,
const Matrix< T > &  B 
)
related

Definition at line 842 of file cmat.h.

References TNT::matmult().

template<class T >
Vector< T > operator* ( const Matrix< T > &  A,
const Vector< T > &  x 
)
related

Definition at line 915 of file cmat.h.

References TNT::matmult().

template<class T >
Matrix< T > operator+ ( const Matrix< T > &  A,
const Matrix< T > &  B 
)
related

Definition at line 730 of file cmat.h.

References TNT::Matrix< T >::num_cols(), and TNT::Matrix< T >::num_rows().

template<class T >
Matrix< T > operator- ( const Matrix< T > &  A,
const Matrix< T > &  B 
)
related

Definition at line 752 of file cmat.h.

References TNT::Matrix< T >::num_cols(), and TNT::Matrix< T >::num_rows().

template<class T>
std::ostream & operator<< ( std::ostream &  s,
const Matrix< char > &  A 
)
related
Author
Jan Woetzel

Definition at line 663 of file cmat.h.

template<class T>
std::ostream & operator<< ( std::ostream &  s,
const Matrix< unsigned char > &  A 
)
related
Author
Jan Woetzel

Definition at line 670 of file cmat.h.

template<class T >
std::ostream & operator<< ( std::ostream &  s,
const Matrix< T > &  A 
)
related
Author
Jan Woetzel

Definition at line 695 of file cmat.h.

template<class T>
std::istream & operator>> ( std::istream &  s,
Matrix< unsigned char > &  A 
)
related
Author
Jan Woetzel

Definition at line 703 of file cmat.h.

References TNT::Matrix< T >::Read().

template<class T>
std::istream & operator>> ( std::istream &  s,
Matrix< char > &  A 
)
related
Author
Jan Woetzel

Definition at line 711 of file cmat.h.

References TNT::Matrix< T >::Read().

template<class T >
std::istream & operator>> ( std::istream &  s,
Matrix< T > &  A 
)
related
Author
Jan Woetzel

Definition at line 719 of file cmat.h.

References TNT::Matrix< T >::Read().

Member Data Documentation

template<class T>
Subscript TNT::Matrix< T >::m_
protectedinherited
template<class T>
Subscript TNT::Matrix< T >::mn_
protectedinherited
template<class T>
Subscript TNT::Matrix< T >::n_
protectedinherited
template<class T>
T** TNT::Matrix< T >::row_
protectedinherited
template<class T>
T** TNT::Matrix< T >::rowm1_
protectedinherited
template<class T>
T* TNT::Matrix< T >::v_
protectedinherited
template<class T>
T* TNT::Matrix< T >::vm1_
protectedinherited

The documentation for this class was generated from the following files: