#include <AbsolutePoseSacProblem.hpp>
Public Types | |
enum | Algorithm { TWOPT = 0 , KNEIP = 1 , GAO = 2 , EPNP = 3 , GP3P = 4 } |
typedef transformation_t | model_t |
typedef opengv::absolute_pose::AbsoluteAdapterBase | adapter_t |
typedef enum opengv::sac_problems::absolute_pose::AbsolutePoseSacProblem::Algorithm | algorithm_t |
![]() | |
typedef transformation_t | model_t |
Public Member Functions | |
AbsolutePoseSacProblem (adapter_t &adapter, algorithm_t algorithm, bool randomSeed=true) | |
Constructor. | |
AbsolutePoseSacProblem (adapter_t &adapter, algorithm_t algorithm, const std::vector< int > &indices, bool randomSeed=true) | |
Constructor. | |
virtual | ~AbsolutePoseSacProblem () |
virtual bool | computeModelCoefficients (const std::vector< int > &indices, model_t &outModel) const |
See parent-class. | |
virtual void | getSelectedDistancesToModel (const model_t &model, const std::vector< int > &indices, std::vector< double > &scores) const |
See parent-class. | |
virtual void | optimizeModelCoefficients (const std::vector< int > &inliers, const model_t &model, model_t &optimized_model) |
See parent-class. | |
virtual int | getSampleSize () const |
See parent-class. | |
![]() | |
SampleConsensusProblem (bool randomSeed=true) | |
Contructor. | |
virtual | ~SampleConsensusProblem () |
Destructor. | |
virtual void | getSamples (int &iterations, std::vector< int > &samples) |
Get samples for hypothesis generation. | |
virtual bool | isSampleGood (const std::vector< int > &sample) const |
Check if a set of samples for model generation is degenerate. | |
std::shared_ptr< std::vector< int > > | getIndices () const |
Get a pointer to the vector of indices used. | |
void | drawIndexSample (std::vector< int > &sample) |
Sub-function for getting samples for hypothesis generation. | |
virtual void | getDistancesToModel (const model_t &model_coefficients, std::vector< double > &distances) |
Compute the distances of all samples which respect to given model coefficients. | |
virtual void | selectWithinDistance (const model_t &model_coefficients, const double threshold, std::vector< int > &inliers) |
Select all the inlier samples whith respect to given model coefficients. | |
virtual int | countWithinDistance (const model_t &model_coefficients, const double threshold) |
Count all the inlier samples whith respect to given model coefficients. | |
void | setIndices (const std::vector< int > &indices) |
Set the indices_ variable (see member-description). | |
void | setUniformIndices (int N) |
Use this method if you want to use all samples. | |
int | rnd () |
Get a random number. | |
Protected Attributes | |
adapter_t & | _adapter |
algorithm_t | _algorithm |
Additional Inherited Members | |
![]() | |
int | max_sample_checks_ |
std::shared_ptr< std::vector< int > > | indices_ |
std::vector< int > | shuffled_indices_ |
std::mt19937 | rng_alg_ |
std-based random number generator algorithm. | |
std::shared_ptr< std::uniform_int_distribution<> > | rng_dist_ |
std-based random number generator distribution. | |
std::shared_ptr< std::function< int()> > | rng_gen_ |
std-based random number generator. | |
Provides functions for fitting an absolute-pose model to a set of bearing-vector to point correspondences, using different algorithms (central and non-central ones). Used in a sample-consenus paradigm for rejecting outlier correspondences.
typedef opengv::absolute_pose::AbsoluteAdapterBase opengv::sac_problems::absolute_pose::AbsolutePoseSacProblem::adapter_t |
The type of adapter that is expected by the methods
typedef enum opengv::sac_problems::absolute_pose::AbsolutePoseSacProblem::Algorithm opengv::sac_problems::absolute_pose::AbsolutePoseSacProblem::algorithm_t |
The possible algorithms for solving this problem
The model we are trying to fit (transformation)
The possible algorithms for solving this problem
|
inline |
Constructor.
[in] | adapter | Visitor holding bearing vectors, world points, etc. |
[in] | algorithm | The algorithm we want to use. |
[in] | randomSeed | Whether to seed the random number generator with the current time. |
|
inline |
Constructor.
[in] | adapter | Visitor holding bearing vectors, world points, etc. |
[in] | algorithm | The algorithm we want to use. |
[in] | indices | A vector of indices to be used from all available correspondences. |
[in] | randomSeed | Whether to seed the random number generator with the current time. |
|
inlinevirtual |
Destructor.
|
virtual |
See parent-class.
Implements opengv::sac::SampleConsensusProblem< transformation_t >.
|
virtual |
See parent-class.
Implements opengv::sac::SampleConsensusProblem< transformation_t >.
|
virtual |
See parent-class.
Implements opengv::sac::SampleConsensusProblem< transformation_t >.
|
virtual |
See parent-class.
Implements opengv::sac::SampleConsensusProblem< transformation_t >.
|
protected |
The adapter holding all input data
|
protected |
The algorithm we are using