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 | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::Covariance3Dto2D Class Reference

Projection of 3D points with uncertainties covariances into the 2d image plane taking the camera pose uncertainty into account. More...

#include <Geometry/Covariance3Dto2D.hh>

+ Inheritance diagram for BIAS::Covariance3Dto2D:
+ Collaboration diagram for BIAS::Covariance3Dto2D:

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
 Covariance3Dto2D (BIAS::KMatrix &K, enum BIAS::PMatrixBase::E_ParametrizationType par)
 
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...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
int Project (const BIAS::Vector< double > &Pose, const BIAS::Matrix< double > &Cov_Pose, const BIAS::Vector3< double > &X, const BIAS::Matrix3x3< double > &Cov_X, BIAS::Vector2< double > &x, BIAS::Matrix2x2< double > &Cov_x) const
 project covariance onto w=1 plane in camera coordinate system More...
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetAlpha (const double alpha)
 Sets the alpha parameter. More...
 
void SetBeta (const double beta)
 Sets the beta parameter. More...
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetK (const BIAS::KMatrix &K)
 
void SetUseSVD (const bool use_svd)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
int Transform (const Vector< double > &src_mean, const Matrix< double > &src_cov, Vector< double > &dst_mean, Matrix< double > &dst_cov) const
 computes the second order approximation of the transformations of the mean and the associated covariance for the point transformation Transform_(). More...
 
 ~Covariance3Dto2D ()
 

Static Public Member Functions

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

Protected Member Functions

int ComputeSigmaPoints_ (const Vector< double > &src_mean, const Matrix< double > &src_cov, std::vector< WeightedSigmaPoint > &sigma_points) const
 The covariance of a n-dimensional vector is approximated using 2n+1 so called sigma points with associated weights. More...
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
virtual int Transform_ (const BIAS::Vector< double > &src, BIAS::Vector< double > &dst) const
 src is a vector consisting of [ 3d point, camera center, orientation ] The orientation must be represented using one case from E_Parametrization dst is the projection into the image 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
 
double Alpha_
 the alpha parameter determines the spread of the sigma points More...
 
double Beta_
 beta is used to incorporate prior knowledge of the distribution of x. More...
 
BIAS::KMatrix K_
 
double Kappa_
 kappa is a secondary scaling parameter. More...
 
enum
BIAS::PMatrixBase::E_ParametrizationType 
Parametrization_
 
bool UseSVD_
 

Static Protected Attributes

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

Detailed Description

Projection of 3D points with uncertainties covariances into the 2d image plane taking the camera pose uncertainty into account.

Given a point in 3D with uncertainty represented/approximated by a multivariate normal distribution (i.e. 3x3 covariance matrix). Given further a camera pose (camer center and orientation).

The algorithm computes the projection of the 3D point into the image taking the camera pose uncertainty into account. The probabilty distribution function in the image is represented by a 2D normal distribution (i.e. a 2D covariance matrix).

The resulting 2D covariance matrix is approximated using the unscented transform. See UnscentedTransform for details.

To use it instantiate this class with the appropriate parametrization of the camera orientation. Currently Euler angles, axis (norm 1) and angle, axis times angle and quaternion are supported.

See Example/ExampleCovariance3Dto2D for exemplary usage.

TODO: implement for point normalization instead of homogenization

Author
woelk 02/2006

Definition at line 41 of file Covariance3Dto2D.hh.

Constructor & Destructor Documentation

Covariance3Dto2D::Covariance3Dto2D ( BIAS::KMatrix K,
enum BIAS::PMatrixBase::E_ParametrizationType  par 
)

Definition at line 12 of file Covariance3Dto2D.cpp.

Covariance3Dto2D::~Covariance3Dto2D ( )

Definition at line 19 of file Covariance3Dto2D.cpp.

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 UnscentedTransform::ComputeSigmaPoints_ ( const Vector< double > &  src_mean,
const Matrix< double > &  src_cov,
std::vector< WeightedSigmaPoint > &  sigma_points 
) const
protectedinherited

The covariance of a n-dimensional vector is approximated using 2n+1 so called sigma points with associated weights.

The points and weights are computed in this function

Returns
0=ok, <0 on error (bad cov, ...)

Definition at line 138 of file UnscentedTransform.cpp.

References BIAS::UnscentedTransform::Alpha_, BIAS::UnscentedTransform::Beta_, BIAS::Debug::DebugLevelIsSet(), BIAS::Matrix< T >::GetCol(), BIAS::Matrix< T >::GetCols(), BIAS::UnscentedTransform::Kappa_, Lapack_Cholesky_SymmetricPositiveDefinit(), BIAS::Less(), TNT::Matrix< T >::num_cols(), TNT::Matrix< T >::num_rows(), BIAS::Vector< T >::Size(), BIAS::SVD::SqrtT(), and BIAS::UnscentedTransform::UseSVD_.

Referenced by BIAS::UnscentedTransform::Transform().

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.

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.

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.

int Covariance3Dto2D::Project ( const BIAS::Vector< double > &  Pose,
const BIAS::Matrix< double > &  Cov_Pose,
const BIAS::Vector3< double > &  X,
const BIAS::Matrix3x3< double > &  Cov_X,
BIAS::Vector2< double > &  x,
BIAS::Matrix2x2< double > &  Cov_x 
) const

project covariance onto w=1 plane in camera coordinate system

Returns
0: ok, -1 if ray behind/parallel to that plane

Definition at line 23 of file Covariance3Dto2D.cpp.

References TNT::Vector< T >::newsize(), TNT::Matrix< T >::newsize(), BIAS::Matrix< T >::SetZero(), BIAS::Vector< T >::Size(), and BIAS::UnscentedTransform::Transform().

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::UnscentedTransform::SetAlpha ( const double  alpha)
inlineinherited

Sets the alpha parameter.

The alpha parameter determines the spread of the sigma points

Definition at line 80 of file UnscentedTransform.hh.

void BIAS::UnscentedTransform::SetBeta ( const double  beta)
inlineinherited

Sets the beta parameter.

beta is used to incorporate prior knowledge of the distribution of x. For Gaussian distributions beta = 2.0 is optiomal

Definition at line 86 of file UnscentedTransform.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::Covariance3Dto2D::SetK ( const BIAS::KMatrix K)
inline

Definition at line 59 of file Covariance3Dto2D.hh.

void BIAS::UnscentedTransform::SetUseSVD ( const bool  use_svd)
inlineinherited

Definition at line 89 of file UnscentedTransform.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.

int UnscentedTransform::Transform ( const Vector< double > &  src_mean,
const Matrix< double > &  src_cov,
Vector< double > &  dst_mean,
Matrix< double > &  dst_cov 
) const
virtualinherited
int Covariance3Dto2D::Transform_ ( const BIAS::Vector< double > &  src,
BIAS::Vector< double > &  dst 
) const
protectedvirtual

src is a vector consisting of [ 3d point, camera center, orientation ] The orientation must be represented using one case from E_Parametrization dst is the projection into the image

Implements BIAS::UnscentedTransform.

Definition at line 65 of file Covariance3Dto2D.cpp.

References BIAS::PMatrixBase::Compose(), BIAS::HomgPoint2D::Homogenize(), K_, TNT::Vector< T >::newsize(), BIAS::Vector3< T >::NormL2(), Parametrization_, BIAS::HomgPoint3D::Set(), and BIAS::Vector< T >::Size().

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=().

double BIAS::UnscentedTransform::Alpha_
protectedinherited

the alpha parameter determines the spread of the sigma points

Definition at line 94 of file UnscentedTransform.hh.

Referenced by BIAS::UnscentedTransform::ComputeSigmaPoints_().

double BIAS::UnscentedTransform::Beta_
protectedinherited

beta is used to incorporate prior knowledge of the distribution of x.

For Gaussian distributions beta = 2.0 is optiomal

Definition at line 97 of file UnscentedTransform.hh.

Referenced by BIAS::UnscentedTransform::ComputeSigmaPoints_().

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

Definition at line 513 of file Debug.hh.

BIAS::KMatrix BIAS::Covariance3Dto2D::K_
protected

Definition at line 63 of file Covariance3Dto2D.hh.

Referenced by Transform_().

double BIAS::UnscentedTransform::Kappa_
protectedinherited

kappa is a secondary scaling parameter.

In other papers from Uhlman kappa is fixed to 1.0

Definition at line 100 of file UnscentedTransform.hh.

Referenced by BIAS::UnscentedTransform::ComputeSigmaPoints_().

enum BIAS::PMatrixBase::E_ParametrizationType BIAS::Covariance3Dto2D::Parametrization_
protected

Definition at line 64 of file Covariance3Dto2D.hh.

Referenced by Transform_().

bool BIAS::UnscentedTransform::UseSVD_
protectedinherited

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