Basic Image AlgorithmS Library
2.8.0
|
Complete Sampling Consesus. More...
#include <MathAlgo/COSAC.hh>
Classes | |
struct | SolStruct |
Public Member Functions | |
void | AddDebugLevel (const long int lv) |
void | AddDebugLevel (const std::string &name) |
COSAC (RANSACEvaluatorInterface< SolutionType > *shi) | |
c'tor 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... | |
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 | SetRefineSolutions (const unsigned refine_solutions) |
void | ShowDebugLevel (std::ostream &os=std::cout) const |
prints all internally known debuglevels More... | |
int | SolveMaster (const double inlying_data_fraction, const double max_score, SolutionType &solution, std::vector< bool > &inliers, unsigned &num_inliers, double &score) |
virtual | ~COSAC () |
d'tor More... | |
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... | |
void | EvaluateSolutions_ (const unsigned data_size) |
evaluates the solutions More... | |
int | GenerateRefinedSolutions_ (const unsigned data_size) |
returns the number of succesfully refined solutions More... | |
int | GenerateSolutions_ (const unsigned sample_size, const unsigned data_size) |
returns the number of generated solution More... | |
bool | GetNextCombination_ (const unsigned sample_size, const unsigned data_size, std::vector< unsigned > &which_samples) |
Returns the next combination of samples from which a solution can be computed. More... | |
int | GetSolution_ (const unsigned min_num_inliers, const double max_score, SolutionType &solution, std::vector< bool > &inliers, unsigned &num_inliers, double &score) const |
struct SolStruct * | GetSolutionMaxInliers_ (const unsigned min_num_inliers, const double max_score) const |
struct SolStruct * | GetSolutionMinScore_ (const unsigned min_num_inliers, const double max_score) const |
bool | IsInlier_ (typename std::list< SolStruct >::iterator solution, const unsigned eval_index, double &score) |
Protected Attributes | |
bool | _bRefineSolutions |
should the solutions be refined? More... | |
long int | _liDebugLevel |
long int | _liNextDebugLevel |
new concept, debuglevel are managed here in the debug class More... | |
std::list< SolStruct > | _Solutions |
all solutions More... | |
std::map< std::string, long int > | _String2Debuglevel |
unsigned | _uiDataSize |
the number of data for evaluation More... | |
unsigned | _uiSampleSize |
the number of samples needed by GetSampleSolutions More... | |
RANSACEvaluatorInterface < SolutionType > * | RANSACEvaluator_ |
the helper class for solution computation and sample evaluation More... | |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
Complete Sampling Consesus.
Samples the space of possible solutions completely. The algorithm (complete sampling and evaluation) is decoupled from the problem (for example HMatrix estimation) using a common interface class, the RANSACEvaluatorInterace. To use this class it is therefore necessary to derive from RANSACEvaluatorInterface and overload the functions:
bool IsInlier(const SolutionType& solution, const unsigned data_index, double& score) = 0;
int GetSampleSolutions(const std::vector<unsigned> &which_samples, std::vector<SolutionType> &solutions)= 0;
bool RefineSolution(const std::vector<bool>& inliers, SolutionType& solution) = 0;
Afterwards instantiate COSAC with a pointer to the sibling of RANSACEvaluatorInterface as argment to the constructor and call
BIAS::COSAC< SolutionType >::COSAC | ( | RANSACEvaluatorInterface< SolutionType > * | shi | ) |
c'tor
Definition at line 213 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::_uiSampleSize, BIAS::Debug::NewDebugLevel(), and BIAS::COSAC< SolutionType >::RANSACEvaluator_.
|
inlinevirtual |
|
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 |
|
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 |
|
protected |
returns the number of succesfully refined solutions
Definition at line 323 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::SolStruct::eval_index, BIAS::COSAC< SolutionType >::SolStruct::inliers, BIAS::COSAC< SolutionType >::SolStruct::num_inliers, BIAS::COSAC< SolutionType >::SolStruct::refined, BIAS::COSAC< SolutionType >::SolStruct::score, and BIAS::COSAC< SolutionType >::SolStruct::solution.
|
protected |
returns the number of generated solution
Definition at line 295 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::SolStruct::eval_index, BIAS::COSAC< SolutionType >::SolStruct::inliers, BIAS::COSAC< SolutionType >::SolStruct::num_inliers, BIAS::COSAC< SolutionType >::SolStruct::refined, BIAS::COSAC< SolutionType >::SolStruct::score, and BIAS::COSAC< SolutionType >::SolStruct::solution.
|
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 |
|
protected |
Definition at line 437 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::SolStruct::inliers, BIAS::COSAC< SolutionType >::SolStruct::num_inliers, BIAS::COSAC< SolutionType >::SolStruct::score, and BIAS::COSAC< SolutionType >::SolStruct::solution.
|
inlineprotected |
Definition at line 152 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::_Solutions.
|
inlineprotected |
Definition at line 183 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::_Solutions.
|
protected |
|
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().
|
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 |
|
inline |
Definition at line 96 of file COSAC.hh.
References BIAS::COSAC< SolutionType >::_bRefineSolutions.
|
inlineinherited |
int BIAS::COSAC< SolutionType >::SolveMaster | ( | const double | inlying_data_fraction, |
const double | max_score, | ||
SolutionType & | solution, | ||
std::vector< bool > & | inliers, | ||
unsigned & | num_inliers, | ||
double & | score | ||
) |
Definition at line 231 of file COSAC.hh.
References BIAS::BinomialCoefficient::Compute(), and BIAS::BaseException::What().
|
protected |
should the solutions be refined?
Definition at line 107 of file COSAC.hh.
Referenced by BIAS::COSAC< SolutionType >::SetRefineSolutions().
|
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=().
|
protected |
all solutions
Definition at line 125 of file COSAC.hh.
Referenced by BIAS::COSAC< SolutionType >::GetSolutionMaxInliers_(), and BIAS::COSAC< SolutionType >::GetSolutionMinScore_().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
|
protected |
the number of samples needed by GetSampleSolutions
Definition at line 103 of file COSAC.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
|
protected |
the helper class for solution computation and sample evaluation
Definition at line 101 of file COSAC.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC().