Basic Image AlgorithmS Library
2.8.0
|
compute standard P1/P2 from F. More...
#include <Geometry/PMatrixEstimation.hh>
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 |
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
Definition at line 48 of file PMatrixEstimation.hh.
PMatrixEstimation::PMatrixEstimation | ( | ) |
Standard constructor does nothing.
Definition at line 63 of file PMatrixEstimation.cpp.
References BIAS::Debug::NewDebugLevel().
|
inline |
Standard Destructor does nothing.
Definition at line 55 of file PMatrixEstimation.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 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.
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_.
|
protected |
private function, that can determine focal length using different initial guesses for AutoCalib
Definition at line 417 of file PMatrixEstimation.cpp.
References BIAS::PMatrix::Compose(), ComputeFromFDirect(), BIAS::Vector3< T >::CoordEuclideanToSphere(), BIAS::Vector3< T >::CoordSphereToEuclidean(), errorAll_, errorSum_, BIAS::Matrix< T >::GetCol(), BIAS::KMatrix::GetFx(), BIAS::KMatrix::GetHx(), BIAS::KMatrix::GetHy(), BIAS::RMatrixBase::GetRotationAnglesXYZ(), BIAS::EMatrix::InitFromF(), BIAS::PMatrix::InvalidateDecomposition(), BIAS::LevenbergMarquardt(), BIAS::Vector3< T >::Normalize(), BIAS::KMatrix::SetFx(), BIAS::KMatrix::SetFy(), BIAS::KMatrix::SetHx(), BIAS::KMatrix::SetHy(), BIAS::Matrix3x4< T >::SetIdentity(), BIAS::Matrix3x3< T >::SetIdentity(), BIAS::RMatrixBase::SetXYZ(), and BIAS::Matrix3x3< T >::Transpose().
Referenced by AutoCalib().
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
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.
Definition at line 182 of file PMatrixEstimation.cpp.
References FindClosestP2(), BIAS::FMatrix::GetEpipoles(), globalEpipole2_, globalM2_, InitP1P2Trans(), BIAS::Vector3< T >::Normalize(), and BIAS::Powell().
|
static |
Definition at line 120 of file PMatrixEstimation.cpp.
References BIAS::Matrix3x3< T >::GetDeterminant(), BIAS::Matrix3x3< T >::NormFrobenius(), BIAS::Vector3< T >::OuterProduct(), BIAS::Matrix3x3< T >::SetAsCrossProductMatrix(), and BIAS::Matrix3x3< T >::Transpose().
Referenced by ComputeFromFDirect(), and ComputeRotationCenter().
|
static |
Definition at line 147 of file PMatrixEstimation.cpp.
References ComputeRotation(), BIAS::PMatrix::GetC(), BIAS::FMatrix::GetEpipoles(), BIAS::Matrix3x3< T >::GetInverse(), BIAS::Vector3< T >::MultiplyIP(), BIAS::Vector3< T >::NormL2(), BIAS::Matrix3x3< T >::SetAsCrossProductMatrix(), and BIAS::Matrix3x3< T >::Transpose().
|
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 |
|
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().
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
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().
|
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(), PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
|
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 |
|
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=().
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_().
|
staticprotectedinherited |
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().