Basic Image AlgorithmS Library
2.8.0
|
Computes mean of rotations due to different measures. More...
#include <Geometry/RotationAveraging.hh>
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
int | ChordalL2Mean (const std::vector< BIAS::RMatrix > &R, BIAS::RMatrix &meanR) |
Compute chordal L2-mean of rotations. More... | |
int | ChordalL2Mean (const std::vector< BIAS::Quaternion< double > > &Q, BIAS::Quaternion< double > &meanQ) |
Compute chordal L2-mean of rotations using unit quaternions. More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
int | GeodesicL1Mean (const std::vector< BIAS::RMatrix > &R, BIAS::RMatrix &meanR) |
Compute geodesic L1-mean (geodesic median) of rotations. More... | |
int | GeodesicL2Mean (const std::vector< BIAS::RMatrix > &R, BIAS::RMatrix &meanR) |
Compute geodesic L2-mean (Karcher/geometric mean) of rotations. More... | |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
int | LogarithmicL2Mean (const std::vector< BIAS::RMatrix > &R, BIAS::RMatrix &meanR) |
Compute matrix logarithm L2-mean of rotations. More... | |
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 | QuaternionL2Mean (const std::vector< BIAS::RMatrix > &R, BIAS::RMatrix &meanR) |
Compute quaternion L2-mean of rotations. More... | |
int | QuaternionL2Mean (const std::vector< BIAS::Quaternion< double > > &Q, BIAS::Quaternion< double > &meanQ) |
Compute quaternion L2-mean of rotations. More... | |
void | RemoveDebugLevel (const long int lv) |
void | RemoveDebugLevel (const std::string &name) |
RotationAveraging () | |
void | SetDebugLevel (const long int lv) |
void | SetDebugLevel (const std::string &name) |
void | SetDebugStream (const std::ostream &os) |
void | SetMaxIterations (unsigned int num) |
Set maximal number of iterations for geodesic L1-/L2-mean computation. More... | |
void | SetTolerance (double epsilon) |
Set threshold for convergence of iterative geodesic L1-/L2-mean computation. More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
~RotationAveraging () | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Protected Member Functions | |
long | ConsumeNextFreeDebuglevel_ () |
returns the next available debuglevel 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 |
Computes mean of rotations due to different measures.
This tool computes the average rotation of given rotations R_1,...,R_n with respect to different distance measures d: SO(3) x SO(3) -> R on rotations as described in [1]. The L2-mean for a given d is defined by the rotation matrix R from mean(R_1,...,R_n) = {i=1}^N d(R,R_i)^2 while the L1-mean is given by {i=1}^N d(R,R_i).
Implemented so far are:
While closed form solutions exist for the L2-means (except geodesic mean), iterative algorithms are given for the geodesic L1-/L2-mean.
The solution is in general only optimal under the assumptions that the rotation angles of all R_i are less than 180 degree resp. all rotations cover less than a hemisphere of the space SO(3).
[1] Y. Dai, J. Trumpf, H. Li, N. Barnes & R. Hartley: "Rotation Averaging with Application to Camera-Rig Calibration", 2009. [2] R. Hartley, K. Aftab, J. Trumpf: "L1 Rotation Averaging Using the Weiszfeld Algorithm", 2011.
Definition at line 55 of file RotationAveraging.hh.
RotationAveraging::RotationAveraging | ( | ) |
Definition at line 14 of file RotationAveraging.cpp.
References BIAS::Debug::NewDebugLevel().
|
inline |
Definition at line 61 of file RotationAveraging.hh.
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
int RotationAveraging::ChordalL2Mean | ( | const std::vector< BIAS::RMatrix > & | R, |
BIAS::RMatrix & | meanR | ||
) |
Compute chordal L2-mean of rotations.
[in] | R | Input rotation matrices to compute the average for |
[out] | meanR | Output average rotation matrix |
Definition at line 154 of file RotationAveraging.cpp.
References BIAS::RMatrix::EnforceConstraints(), and BIAS::MatrixZero.
int RotationAveraging::ChordalL2Mean | ( | const std::vector< BIAS::Quaternion< double > > & | Q, |
BIAS::Quaternion< double > & | meanQ | ||
) |
Compute chordal L2-mean of rotations using unit quaternions.
[in] | Q | Input unit quaternions to compute the average for |
[out] | meanQ | Output average rotation as unit quaternion |
Definition at line 170 of file RotationAveraging.cpp.
References BIAS::Matrix< T >::GetCol(), BIAS::SVD::GetV(), BIAS::MatrixZero, BIAS::Quaternion< T >::Normalize(), and BIAS::Vector4< T >::SetZero().
|
inlineprotectedinherited |
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
int RotationAveraging::GeodesicL1Mean | ( | const std::vector< BIAS::RMatrix > & | R, |
BIAS::RMatrix & | meanR | ||
) |
Compute geodesic L1-mean (geodesic median) of rotations.
[in] | R | Input rotation matrices to compute the average for |
[out] | meanR | Output average rotation matrix |
Definition at line 21 of file RotationAveraging.cpp.
References BIAS::Equal(), GeodesicL2Mean(), BIAS::RMatrixBase::GetRotationAxisAngle(), BIAS::Vector3< T >::MultiplyIP(), BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), BIAS::RMatrixBase::Set(), BIAS::Vector3< T >::SetZero(), and BIAS::Matrix3x3< T >::Transpose().
int RotationAveraging::GeodesicL2Mean | ( | const std::vector< BIAS::RMatrix > & | R, |
BIAS::RMatrix & | meanR | ||
) |
Compute geodesic L2-mean (Karcher/geometric mean) of rotations.
[in] | R | Input rotation matrices to compute the average for |
[out] | meanR | Output average rotation matrix |
Definition at line 69 of file RotationAveraging.cpp.
References BIAS::RMatrixBase::GetRotationAxisAngle(), BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), BIAS::RMatrixBase::Set(), BIAS::Vector3< T >::SetZero(), and BIAS::Matrix3x3< T >::Transpose().
Referenced by GeodesicL1Mean().
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
int RotationAveraging::LogarithmicL2Mean | ( | const std::vector< BIAS::RMatrix > & | R, |
BIAS::RMatrix & | meanR | ||
) |
Compute matrix logarithm L2-mean of rotations.
The matrix logarithm of a rotation matrix is the angle/axis vector phi * r, also known as the modified Rodrigues vector.
[in] | R | Input rotation matrices to compute the average for |
[out] | meanR | Output average rotation matrix |
Definition at line 140 of file RotationAveraging.cpp.
References BIAS::Vector3< T >::MultiplyIP(), and BIAS::RMatrixBase::SetFromAxisAngle().
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
int RotationAveraging::QuaternionL2Mean | ( | const std::vector< BIAS::RMatrix > & | R, |
BIAS::RMatrix & | meanR | ||
) |
Compute quaternion L2-mean of rotations.
[in] | R | Input rotation matrices to compute the average for |
[out] | meanR | Output average rotation matrix |
Definition at line 106 of file RotationAveraging.cpp.
References BIAS::RMatrixBase::SetFromQuaternion().
int RotationAveraging::QuaternionL2Mean | ( | const std::vector< BIAS::Quaternion< double > > & | Q, |
BIAS::Quaternion< double > & | meanQ | ||
) |
Compute quaternion L2-mean of rotations.
[in] | Q | Input unit quaternions to compute the average for |
[out] | meanQ | Output average rotation as unit quaternion |
Definition at line 123 of file RotationAveraging.cpp.
References BIAS::Vector4< T >::MultiplyIP(), BIAS::Quaternion< T >::Normalize(), and BIAS::Vector4< T >::SetZero().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
Set maximal number of iterations for geodesic L1-/L2-mean computation.
[in] | num | Maximal number of iterations |
Definition at line 71 of file RotationAveraging.hh.
|
inline |
Set threshold for convergence of iterative geodesic L1-/L2-mean computation.
The algorithm stops if the angular update is less.
[in] | epsilon | Threshold for convergence in radians |
Definition at line 66 of file RotationAveraging.hh.
|
inlineinherited |
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |