Basic Image AlgorithmS Library 2.8.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

BIAS::PMatrixLinear Class Reference

This class computes a PMatrix from 2D/3D correspondences with linear methods. More...

#include <Geometry/PMatrixLinear.hh>

Inheritance diagram for BIAS::PMatrixLinear:
Collaboration diagram for BIAS::PMatrixLinear:

List of all members.

Public Member Functions

void AddDebugLevel (const long int lv)
void AddDebugLevel (const std::string &name)
bool Compute (const std::vector< HomgPoint3D * > &points3D, const std::vector< HomgPoint2D * > &points2D, PMatrix &P)
 computes a least squares solution P via SVD, if at least 6 2d-3d correspondences (pointers) are provided in points3D and points2D.
bool Compute (const std::vector< HomgPoint3D > &points3D, const std::vector< HomgPoint2D > &points2D, PMatrix &P)
 computes a least squares solution P via SVD, if at least 6 2d-3d correspondences are provided in points3D and points2D
bool ComputeCalibrated (const std::vector< HomgPoint3D * > &points3D, const std::vector< HomgPoint2D * > &points2D, PMatrix &Pose)
 given n>=6 2D/3D correspondences, compute approximate R and C using linear methods (thats why we need 6, not 3 correspondences !)
bool DebugLevelIsSet (const long int lv) const
bool DebugLevelIsSet (const std::string &name) const
int GetDebugLevel () const
std::ostream & GetDebugStream () const
void GetDebugStream (std::ostream &os) const
bool GetPEstSystemHom (Matrix< double > &A, const std::vector< HomgPoint3D * > &points3D, const std::vector< HomgPoint2D * > &points2D)
 sets up the homogeneous equation system A for pmatrix computation using the 2d/3d correspondences provided
bool GetPEstSystemInHom (Matrix< double > &A, Vector< double > &b, const std::vector< HomgPoint3D * > &points3D, const std::vector< HomgPoint2D * > &points2D)
 sets up an inhomogeneous equation system A for pmatrix computation using the 2d/3d correspondences provided
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel
 PMatrixLinear ()
void PrintDebugLevel (std::ostream &os=std::cout) const
void RemoveDebugLevel (const std::string &name)
void RemoveDebugLevel (const long int lv)
void SetDebugLevel (const std::string &name)
void SetDebugLevel (const long int lv)
void SetDebugStream (const std::ostream &os)
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels

Static Public Member Functions

static long int GetGlobalDebugLevel ()
static void SetGlobalDebugLevel (long int lev)

Protected Member Functions

long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel

Protected Attributes

long int _liDebugLevel
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class
std::map< std::string, long int > _String2Debuglevel

Static Protected Attributes

static std::ostream _zDebugStream
static long int GlobalDebugLevel = 0

Detailed Description

This class computes a PMatrix from 2D/3D correspondences with linear methods.

No nonlinear constraints are enforced: If you have noisy points, you may get inexact rotations or non-metric PMatrices, although you compute in a metric framework. however, this class provides functions which can also be applied in projectively skewed space.

Author:
koeser/frahm
Examples:

ExamplePMatrix.cpp.

Definition at line 50 of file PMatrixLinear.hh.


Constructor & Destructor Documentation

PMatrixLinear::PMatrixLinear ( )

Definition at line 33 of file PMatrixLinear.cpp.


Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv) [inline, inherited]
void BIAS::Debug::AddDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 363 of file Debug.hh.

bool PMatrixLinear::Compute ( const std::vector< HomgPoint3D * > &  points3D,
const std::vector< HomgPoint2D * > &  points2D,
PMatrix P 
)

computes a least squares solution P via SVD, if at least 6 2d-3d correspondences (pointers) are provided in points3D and points2D.

Attention:
P may not exactly be decomposable due to noise in points
Parameters:
points3D3D points which project to points2D
points2D2D projections of points3D, any K allowed !
Presulting (not always metric) PMatrix
Returns:
false on ambiguity, true on success
Examples:
ExamplePMatrix.cpp.

Definition at line 57 of file PMatrixLinear.cpp.

References BIAS::Matrix< T >::GetRow(), BIAS::SVD::GetS(), BIAS::SVD::GetVT(), BIAS::SVD::GetZeroThreshold(), BIAS::Matrix< T >::NormalizeRows(), BIAS::SVD::RelNullspaceDim(), and BIAS::PMatrixBase::SetFromVector().

bool PMatrixLinear::Compute ( const std::vector< HomgPoint3D > &  points3D,
const std::vector< HomgPoint2D > &  points2D,
PMatrix P 
)

computes a least squares solution P via SVD, if at least 6 2d-3d correspondences are provided in points3D and points2D

Algorithm used is DLT. Fails if points3D are coplanar.

Attention:
P may not exactly be decomposable due to noise in points
Parameters:
points3D3D points which project to points2D
points2D2D projections of points3D, any K allowed !
Presulting (not always metric) PMatrix
Returns:
false on ambiguity, true on success

Definition at line 40 of file PMatrixLinear.cpp.

bool PMatrixLinear::ComputeCalibrated ( const std::vector< HomgPoint3D * > &  points3D,
const std::vector< HomgPoint2D * > &  points2D,
PMatrix Pose 
)

given n>=6 2D/3D correspondences, compute approximate R and C using linear methods (thats why we need 6, not 3 correspondences !)

The lines of each two 3D points and their projections into the image are used to determine the rotation of P. For n points, we have n(n-1)/2 lines (quadratic in n!) and also linear equations, dont pass too many points if you are interested in performance ! After R is determined, C is computed separately using linear methods (DLT) starting from the equation Rx ~= [ I |-C] X Algorithm fails if points3D are coplanar

Attention:
R is no real rotation, enforce afterwards, if you want that!
Parameters:
points3D3D points which project to points2D
points2D2D projections of points3D, K=Identity required !
Poseresult R^T*[ I |-C]
Returns:
true on success, false on error (ambiguity)
Author:
koeser 10/2004
Examples:
ExamplePMatrix.cpp.

Definition at line 220 of file PMatrixLinear.cpp.

References BIAS::PMatrix::Compose(), BIAS::Matrix3x3< T >::GetData(), BIAS::Matrix< T >::GetDataArray(), BIAS::Matrix< T >::GetRow(), BIAS::SVD::GetS(), BIAS::Vector3< T >::GetSkewSymmetricMatrix(), BIAS::SVD::GetU(), BIAS::SVD::GetVT(), BIAS::Vector3< T >::OuterProduct(), BIAS::SVD::RelNullspaceDim(), BIAS::Vector3< T >::Set(), and BIAS::Matrix3x3< T >::SetIdentity().

long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( ) [inline, protected, inherited]

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 522 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const [inline, inherited]
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const [inline, inherited]

Definition at line 351 of file Debug.hh.

int BIAS::Debug::GetDebugLevel ( ) const [inline, inherited]
std::ostream& BIAS::Debug::GetDebugStream ( ) const [inline, inherited]

Definition at line 406 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const [inline, inherited]

Definition at line 415 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( ) [inline, static, inherited]

Definition at line 432 of file Debug.hh.

bool PMatrixLinear::GetPEstSystemHom ( Matrix< double > &  A,
const std::vector< HomgPoint3D * > &  points3D,
const std::vector< HomgPoint2D * > &  points2D 
)

sets up the homogeneous equation system A for pmatrix computation using the 2d/3d correspondences provided

Author:
frahm

Definition at line 116 of file PMatrixLinear.cpp.

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

bool PMatrixLinear::GetPEstSystemInHom ( Matrix< double > &  A,
Vector< double > &  b,
const std::vector< HomgPoint3D * > &  points3D,
const std::vector< HomgPoint2D * > &  points2D 
)

sets up an inhomogeneous equation system A for pmatrix computation using the 2d/3d correspondences provided

Author:
frahm

Definition at line 168 of file PMatrixLinear.cpp.

References TNT::Vector< T >::newsize(), and TNT::Matrix< T >::newsize().

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const [inline, inherited]

looks up a debuglevel in the internal map, returns 0 if not found

Author:
woelk 09/2006

Definition at line 455 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name) [inline, inherited]
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

Definition at line 384 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv) [inline, inherited]

Definition at line 370 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 377 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const std::string &  name) [inline, inherited]

Definition at line 326 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv) [inline, inherited]
void BIAS::Debug::SetDebugStream ( const std::ostream &  os) [inline, inherited]

Definition at line 399 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev) [inline, static, inherited]

Definition at line 425 of file Debug.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const [inline, inherited]

prints all internally known debuglevels

Author:
woelk 09/2006

Definition at line 497 of file Debug.hh.


Member Data Documentation

long int BIAS::Debug::_liDebugLevel [protected, inherited]

Definition at line 511 of file Debug.hh.

Referenced by BIAS::ImageBase::operator=(), and BIAS::Debug::operator=().

long int BIAS::Debug::_liNextDebugLevel [protected, inherited]

new concept, debuglevel are managed here in the debug class

Definition at line 517 of file Debug.hh.

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

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel [protected, inherited]

Definition at line 518 of file Debug.hh.

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

std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited]

Definition at line 512 of file Debug.hh.

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

long int BIAS::Debug::GlobalDebugLevel = 0 [static, protected, inherited]

Definition at line 514 of file Debug.hh.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends