Basic Image AlgorithmS Library
2.8.0
|
functions for estimating a fundamental matrix (FMatrix) given a set of 2d-2d correspondences (no outlier checks, not robust !) in two views More...
#include <Geometry/FMatrixEstimation.hh>
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
void | ComputeNormFParam (const BIAS::FMatrix &initialF, BIAS::FMatrix &normF) |
rank 2 F matrix parametrization as implemented in Parametrization does not work in some cases, eg. More... | |
bool | DebugLevelIsSet (const long int lv) const |
bool | DebugLevelIsSet (const std::string &name) const |
int | EightPoint (BIAS::FMatrix &F, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2) |
compute an FMatrix from eight point correspondences More... | |
void | EnforceMaxRank2 (BIAS::FMatrix &F) |
enforces a maximum rank of two by setting the smallest singular value to zero More... | |
FMatrixEstimation (bool NormalizeHartley=true) | |
constructor with general parameters More... | |
int | GetDebugLevel () const |
std::ostream & | GetDebugStream () const |
void | GetDebugStream (std::ostream &os) const |
void | GetDetPolynomial (const BIAS::Vector< double > &f1, const BIAS::Vector< double > &f2, std::vector< POLYNOMIALSOLVE_TYPE > &v) |
set up a polynomial in alpha given Det(alpha*F1+(1-alpha)*F2)=0, where the f vectors are interpreted as the rows of a 3x3 matrix More... | |
int | GoldStandard (BIAS::FMatrix &F, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2) |
Compute FMatrix using the Gold Standard algorithm as in Hartley and Zisserman p. More... | |
int | Linear (BIAS::FMatrix &F, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2) |
compute an FMatrix from more than seven point correspondences 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... | |
int | Optimize (BIAS::FMatrix &F, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2) |
optimize a given FMatrix regarding n 2d point correspondences 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) |
int | SevenPoint (std::vector< BIAS::FMatrix > &Fvec, const std::vector< BIAS::HomgPoint2D > &p1, const std::vector< BIAS::HomgPoint2D > &p2) |
compute a vector of FMatrices from seven point correspondences More... | |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
Static Public Member Functions | |
static long int | GetGlobalDebugLevel () |
static void | SetGlobalDebugLevel (long int lev) |
Public Attributes | |
BIAS::Parametrization * | currentPara_ |
int | itersLM_ |
count Levenberg-Marquardt iterations More... | |
Matrix3x3< double > | NormF1_ |
matrix for saving normalization of 2D points - important for f parametrization More... | |
Matrix3x3< double > | NormF2_ |
matrix for saving normalization of 2D points - important for f parametrization More... | |
std::vector< BIAS::HomgPoint2D > const * | p1_ |
pointer to vector of points in image1 (hack for Optimize) More... | |
std::vector< BIAS::HomgPoint2D > const * | p2_ |
pointer to vector of points in image2 (hack for Optimize) More... | |
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 |
Normalization | N_ |
the normalization object More... | |
bool | NormalizeHartley_ |
flag indicating whether we should normalize the given points before and denormalize the fmatrix after computation, so that it refers to the original points More... | |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
functions for estimating a fundamental matrix (FMatrix) given a set of 2d-2d correspondences (no outlier checks, not robust !) in two views
Definition at line 46 of file FMatrixEstimation.hh.
|
inlineexplicit |
constructor with general parameters
NormalizeHartley | do hartley normalization on 7/8 points |
Definition at line 51 of file FMatrixEstimation.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 |
void FMatrixEstimation::ComputeNormFParam | ( | const BIAS::FMatrix & | initialF, |
BIAS::FMatrix & | normF | ||
) |
rank 2 F matrix parametrization as implemented in Parametrization does not work in some cases, eg.
when epipoles are at infinity. This normalizatin as described in Estimating the fundamental matrix by transforming image points in projective space by Zhang and Loop Application of this function can be seen in Optimize
Definition at line 533 of file FMatrixEstimation.cpp.
References BIAS::FMatrix, BIAS::FMatrix::GetEpipoles(), 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 |
|
inline |
compute an FMatrix from eight point correspondences
This algorithm computes a least squares F on all point correspondences using SVD of a model matrix. Rank 2 is enforced afterwards, therefore
F | matrix which is computed |
p1 | (homogenized!) points in image 1 |
p2 | corresponding (homogenized!) points in image 2 |
Definition at line 102 of file FMatrixEstimation.hh.
void FMatrixEstimation::EnforceMaxRank2 | ( | BIAS::FMatrix & | F | ) |
enforces a maximum rank of two by setting the smallest singular value to zero
F | matrix which has rank MIN{2, previous_rank} afterwards |
Definition at line 502 of file FMatrixEstimation.cpp.
References BIAS::SVD::GetS(), BIAS::SVD::GetU(), and BIAS::SVD::GetVT().
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
void FMatrixEstimation::GetDetPolynomial | ( | const BIAS::Vector< double > & | f1, |
const BIAS::Vector< double > & | f2, | ||
std::vector< POLYNOMIALSOLVE_TYPE > & | v | ||
) |
set up a polynomial in alpha given Det(alpha*F1+(1-alpha)*F2)=0, where the f vectors are interpreted as the rows of a 3x3 matrix
f1 | vector to be interpreted as a 3x3 matrix F1 |
f2 | vector to be interpreted as a 3x3 matrix F2 |
v | vector of polynomial coefficients in PolynomialSolve style |
Definition at line 444 of file FMatrixEstimation.cpp.
References TNT::Vector< T >::size().
Referenced by BIAS::Conic2D::IntersectConicProper().
|
inlinestaticinherited |
int FMatrixEstimation::GoldStandard | ( | BIAS::FMatrix & | F, |
const std::vector< BIAS::HomgPoint2D > & | p1, | ||
const std::vector< BIAS::HomgPoint2D > & | p2 | ||
) |
Compute FMatrix using the Gold Standard algorithm as in Hartley and Zisserman p.
285
F | matrix which is calculated |
p1 | (homogenized points in image1 |
p2 | corresponding (homogenized!) points in image 2 |
Definition at line 319 of file FMatrixEstimation.cpp.
References BIAS::FMatrix::GetEpipoles(), BIAS::Vector3< T >::GetSkewSymmetricMatrix(), BIAS::HomgPoint3D::Homogenize(), BIAS::LevenbergMarquardt(), BIAS::MatrixIdentity, BIAS::Vector3< T >::Normalize(), BIAS::Triangulation::Optimal(), BIAS::Matrix< T >::SetCol(), and BIAS::Matrix3x4< T >::SetIdentity().
int FMatrixEstimation::Linear | ( | BIAS::FMatrix & | F, |
const std::vector< BIAS::HomgPoint2D > & | p1, | ||
const std::vector< BIAS::HomgPoint2D > & | p2 | ||
) |
compute an FMatrix from more than seven point correspondences
This algorithm computes a least squares F on all point correspondences using SVD of a model matrix. Rank 2 is enforced afterwards.
F | matrix which is computed |
p1 | (homogenized!) points in image 1 |
p2 | corresponding (homogenized!) points in image 2 |
Definition at line 205 of file FMatrixEstimation.cpp.
References BIAS::SVD::GetVT(), and BIAS::Matrix3x3< T >::Transpose().
|
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(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
int FMatrixEstimation::Optimize | ( | BIAS::FMatrix & | F, |
const std::vector< BIAS::HomgPoint2D > & | p1, | ||
const std::vector< BIAS::HomgPoint2D > & | p2 | ||
) |
optimize a given FMatrix regarding n 2d point correspondences
minimize an error function on F matrix using iterative nonlinear optimization techniques such as Levenberg/Marquardt
F | matrix which is optimized |
p1 | (homogenized!) points in image 1 |
p2 | corresponding (homogenized!) points in image 2 |
Definition at line 261 of file FMatrixEstimation.cpp.
References BIAS::FMatrix, BIAS::Parametrization::FMatrixToParams(), BIAS::FMatrix::GetEpipolesHomogenized(), BIAS::LevenbergMarquardt(), and BIAS::Matrix3x3< T >::Normalize().
|
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 |
int FMatrixEstimation::SevenPoint | ( | std::vector< BIAS::FMatrix > & | Fvec, |
const std::vector< BIAS::HomgPoint2D > & | p1, | ||
const std::vector< BIAS::HomgPoint2D > & | p2 | ||
) |
compute a vector of FMatrices from seven point correspondences
Depending on the setting of the 3d points and the cameras of the originating epipolar geometry a vector of no, one or three solutions is computed:
Fvec | (output) vector of F matrices which are computed |
p1 | (homogenized!) points in image 1 |
p2 | corresponding (homogenized!) points in image 2 |
Definition at line 130 of file FMatrixEstimation.cpp.
References BIAS::PolynomialSolve::Analytic(), BIAS::PolynomialSolve::CheckCoefficients(), BIAS::SVD::GetNullvector(), and BIAS::Matrix3x3< T >::Transpose().
|
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=().
BIAS::Parametrization* BIAS::FMatrixEstimation::currentPara_ |
Definition at line 167 of file FMatrixEstimation.hh.
|
staticprotectedinherited |
int BIAS::FMatrixEstimation::itersLM_ |
count Levenberg-Marquardt iterations
Definition at line 145 of file FMatrixEstimation.hh.
|
protected |
the normalization object
Definition at line 176 of file FMatrixEstimation.hh.
|
protected |
flag indicating whether we should normalize the given points before and denormalize the fmatrix after computation, so that it refers to the original points
Definition at line 173 of file FMatrixEstimation.hh.
Matrix3x3<double> BIAS::FMatrixEstimation::NormF1_ |
matrix for saving normalization of 2D points - important for f parametrization
Definition at line 163 of file FMatrixEstimation.hh.
Matrix3x3<double> BIAS::FMatrixEstimation::NormF2_ |
matrix for saving normalization of 2D points - important for f parametrization
Definition at line 165 of file FMatrixEstimation.hh.
std::vector<BIAS::HomgPoint2D> const* BIAS::FMatrixEstimation::p1_ |
pointer to vector of points in image1 (hack for Optimize)
Definition at line 141 of file FMatrixEstimation.hh.
std::vector<BIAS::HomgPoint2D> const* BIAS::FMatrixEstimation::p2_ |
pointer to vector of points in image2 (hack for Optimize)
Definition at line 143 of file FMatrixEstimation.hh.