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

compute standard P1/P2 from F. More...

#include <Geometry/PMatrixEstimation.hh>

+ Inheritance diagram for BIAS::PMatrixEstimation:
+ Collaboration diagram for BIAS::PMatrixEstimation:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
int AutoCalib (const BIAS::FMatrix &F, const int width, const int height, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
 given an FMatrix, width and height of the images, and the 2D-correspondences of two images, the Levenberg-Marquardt algorithm is used to determine focal length, and the two projection matrices. More...
 
int ComputeFromFDirect (BIAS::FMatrix &F, const double &BaselineMagnitude, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
 given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euclidean with direct solution of the problem More...
 
void ComputeFromFQuasiEuklid (BIAS::FMatrix &F, double BaselineMagnitude, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
 given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euclidean with nonlinear estimation. More...
 
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
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
 PMatrixEstimation ()
 Standard constructor does nothing. More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
 ~PMatrixEstimation ()
 Standard Destructor does nothing. More...
 

Static Public Member Functions

static void ComputeRotation (BIAS::FMatrix &F, BIAS::HomgPoint2D &Epipole1, BIAS::HomgPoint2D &Epipole2, BIAS::RMatrix &R)
 
static void ComputeRotationCenter (BIAS::PMatrix P1, BIAS::PMatrix P2, BIAS::RMatrix &R, BIAS::Vector3< double > &C)
 
static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Public Attributes

std::vector< std::vector
< double > > 
errorAll_
 
std::vector< double > errorSum_
 
BIAS::HomgPoint2D globalEpipole2_
 
BIAS::Matrix< double > globalM2_
 
int height_
 image height (hack for Levenberg Marquardt) More...
 
double lastError_
 remember error of PErrorFunc More...
 
std::vector< BIAS::HomgPoint2D >
const * 
p1_
 pointer to vector of points in image1 (hack for Levenberg Marquardt) More...
 
std::vector< BIAS::HomgPoint2D >
const * 
p2_
 pointer to vector of points in image2 (hack for Levenberg Marquardt) More...
 
int width_
 image width (hack for Levenberg Marquardt) More...
 

Protected Member Functions

int AutoCalib_ (const BIAS::FMatrix &F, const long int numCorrs, BIAS::KMatrix &K, BIAS::PMatrix &P1, BIAS::PMatrix &P2)
 private function, that can determine focal length using different initial guesses for AutoCalib More...
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
void FindClosestP2 (BIAS::FMatrix &F, BIAS::PMatrix &P2, Matrix3x3< double > &M2Matrix, Vector< double > &C, HomgPoint2D &Epipole2)
 given approximate P2, compute the nearest value of P2 which is exactly compatible with P1 and F More...
 
void InitP1P2Trans (BIAS::PMatrix &P1, BIAS::PMatrix &P2, BIAS::HomgPoint2D &Epipole2)
 set P1 to identity, set P2 to identity with last column epipole2 More...
 

Protected Attributes

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

Static Protected Attributes

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

Detailed Description

compute standard P1/P2 from F.

P1 is set to [ I | 0 ]. The epipole (determined by from F) tells us only the direction of C2, so choose a C2 with |C2| = 1

Author
frahm, koeser
Examples:
ExampleAutoCalib.cpp, ExampleFMatrix.cpp, and PMatrixTest.cpp.

Definition at line 48 of file PMatrixEstimation.hh.

Constructor & Destructor Documentation

PMatrixEstimation::PMatrixEstimation ( )

Standard constructor does nothing.

Definition at line 63 of file PMatrixEstimation.cpp.

References BIAS::Debug::NewDebugLevel().

BIAS::PMatrixEstimation::~PMatrixEstimation ( )
inline

Standard Destructor does nothing.

Definition at line 55 of file PMatrixEstimation.hh.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

int PMatrixEstimation::AutoCalib ( const BIAS::FMatrix F,
const int  width,
const int  height,
const std::vector< BIAS::HomgPoint2D > &  p1,
const std::vector< BIAS::HomgPoint2D > &  p2,
BIAS::PMatrix P1,
BIAS::PMatrix P2 
)

given an FMatrix, width and height of the images, and the 2D-correspondences of two images, the Levenberg-Marquardt algorithm is used to determine focal length, and the two projection matrices.

Author
sedlazeck 04/2008
Returns
0: ok
Examples:
ExampleAutoCalib.cpp.

Definition at line 301 of file PMatrixEstimation.cpp.

References AutoCalib_(), BIAS::PMatrix::Compose(), BIAS::PMatrix::GetC(), BIAS::KMatrix::GetFx(), BIAS::PMatrix::GetK(), BIAS::PMatrix::GetR(), BIAS::EMatrix::GetRotationTranslation(), height_, BIAS::EMatrix::InitFromF(), BIAS::PMatrix::InvalidateDecomposition(), lastError_, BIAS::MatrixIdentity, p1_, p2_, BIAS::KMatrix::SetFx(), BIAS::KMatrix::SetFy(), BIAS::KMatrix::SetHx(), BIAS::KMatrix::SetHy(), BIAS::Matrix3x4< T >::SetIdentity(), BIAS::KMatrix::SetSkew(), and width_.

int PMatrixEstimation::AutoCalib_ ( const BIAS::FMatrix F,
const long int  numCorrs,
BIAS::KMatrix K,
BIAS::PMatrix P1,
BIAS::PMatrix P2 
)
protected
int PMatrixEstimation::ComputeFromFDirect ( BIAS::FMatrix F,
const double &  BaselineMagnitude,
BIAS::PMatrix P1,
BIAS::PMatrix P2 
)

given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euclidean with direct solution of the problem

Returns
0: ok <0: if epipoles could not be extracted and P computation failed
Examples:
ExampleFMatrix.cpp, and PMatrixTest.cpp.

Definition at line 70 of file PMatrixEstimation.cpp.

References ComputeRotation(), BIAS::PMatrix::GetC(), BIAS::FMatrix::GetEpipoles(), BIAS::SVD::GetS(), InitP1P2Trans(), BIAS::PMatrix::InvalidateDecomposition(), BIAS::Vector3< T >::Normalize(), and BIAS::Matrix3x3< T >::Transpose().

Referenced by AutoCalib_().

void PMatrixEstimation::ComputeFromFQuasiEuklid ( BIAS::FMatrix F,
double  BaselineMagnitude,
BIAS::PMatrix P1,
BIAS::PMatrix P2 
)

given an FMatrix set P1 as identity and compute P2 to be consistent with F and P1 such that P2 is euclidean with nonlinear estimation.

Examples:
PMatrixTest.cpp.

Definition at line 182 of file PMatrixEstimation.cpp.

References FindClosestP2(), BIAS::FMatrix::GetEpipoles(), globalEpipole2_, globalM2_, InitP1P2Trans(), BIAS::Vector3< T >::Normalize(), and BIAS::Powell().

void PMatrixEstimation::ComputeRotation ( BIAS::FMatrix F,
BIAS::HomgPoint2D Epipole1,
BIAS::HomgPoint2D Epipole2,
BIAS::RMatrix R 
)
static
void PMatrixEstimation::ComputeRotationCenter ( BIAS::PMatrix  P1,
BIAS::PMatrix  P2,
BIAS::RMatrix R,
BIAS::Vector3< double > &  C 
)
static
long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

void PMatrixEstimation::FindClosestP2 ( BIAS::FMatrix F,
BIAS::PMatrix P2,
Matrix3x3< double > &  M2Matrix,
Vector< double > &  C,
HomgPoint2D Epipole2 
)
protected

given approximate P2, compute the nearest value of P2 which is exactly compatible with P1 and F

Definition at line 575 of file PMatrixEstimation.cpp.

References BIAS::FMatrix::DecomposetoSR(), Lapack_LU_linear_solve(), and BIAS::Matrix< T >::Transpose().

Referenced by ComputeFromFQuasiEuklid().

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

void PMatrixEstimation::InitP1P2Trans ( BIAS::PMatrix P1,
BIAS::PMatrix P2,
BIAS::HomgPoint2D Epipole2 
)
protected

set P1 to identity, set P2 to identity with last column epipole2

Definition at line 560 of file PMatrixEstimation.cpp.

References BIAS::PMatrixBase::set_identity().

Referenced by ComputeFromFDirect(), and ComputeFromFQuasiEuklid().

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

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

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

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

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

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

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

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

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

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

std::vector<std::vector<double> > BIAS::PMatrixEstimation::errorAll_

Definition at line 102 of file PMatrixEstimation.hh.

Referenced by AutoCalib_().

std::vector<double> BIAS::PMatrixEstimation::errorSum_

Definition at line 101 of file PMatrixEstimation.hh.

Referenced by AutoCalib_().

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

BIAS::HomgPoint2D BIAS::PMatrixEstimation::globalEpipole2_

Definition at line 105 of file PMatrixEstimation.hh.

Referenced by ComputeFromFQuasiEuklid().

BIAS::Matrix<double> BIAS::PMatrixEstimation::globalM2_

Definition at line 104 of file PMatrixEstimation.hh.

Referenced by ComputeFromFQuasiEuklid().

int BIAS::PMatrixEstimation::height_

image height (hack for Levenberg Marquardt)

Definition at line 97 of file PMatrixEstimation.hh.

Referenced by AutoCalib().

double BIAS::PMatrixEstimation::lastError_

remember error of PErrorFunc

Definition at line 99 of file PMatrixEstimation.hh.

Referenced by AutoCalib().

std::vector<BIAS::HomgPoint2D> const* BIAS::PMatrixEstimation::p1_

pointer to vector of points in image1 (hack for Levenberg Marquardt)

Definition at line 91 of file PMatrixEstimation.hh.

Referenced by AutoCalib().

std::vector<BIAS::HomgPoint2D> const* BIAS::PMatrixEstimation::p2_

pointer to vector of points in image2 (hack for Levenberg Marquardt)

Definition at line 93 of file PMatrixEstimation.hh.

Referenced by AutoCalib().

int BIAS::PMatrixEstimation::width_

image width (hack for Levenberg Marquardt)

Definition at line 95 of file PMatrixEstimation.hh.

Referenced by AutoCalib().


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