AliceVision
Photogrammetric Computer Vision Framework
Public Types | Public Member Functions | Protected Attributes | List of all members
aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ > Class Template Reference

This is one example (targeted at solvers that operate on correspondences between two views) that shows the "kernel" part of a robust fitting problem: More...

#include <PointFittingKernel.hpp>

Inheritance diagram for aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >:
aliceVision::robustEstimation::PointFittingRansacKernel< SolverT_, ErrorT_, ModelT_, SolverLsT_ >

Public Types

using SolverT = SolverT_
 
using ErrorT = ErrorT_
 
using ModelT = ModelT_
 

Public Member Functions

 PointFittingKernel (const Mat &x1, const Mat &x2)
 
std::size_t getMinimumNbRequiredSamples () const
 Return the minimum number of required samples. More...
 
std::size_t getMaximumNbModels () const
 Return the maximum number of models. More...
 
virtual void fit (const std::vector< std::size_t > &samples, std::vector< ModelT > &models) const
 Extract required sample and fit model(s) to the sample. More...
 
virtual double error (std::size_t sample, const ModelT &model) const
 Return the error associated to the model and a sample point. More...
 
virtual void errors (const ModelT &model, std::vector< double > &errors) const
 Return the errors associated to the model and each sample point. More...
 
std::size_t nbSamples () const
 get the number of putative points More...
 

Protected Attributes

const Mat & _x1
 left corresponding data
 
const Mat & _x2
 right corresponding data
 
const SolverT _kernelSolver {}
 two view solver
 
const ErrorT _errorEstimator {}
 solver error estimation
 

Detailed Description

template<typename SolverT_, typename ErrorT_, typename ModelT_ = Mat3Model>
class aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >

This is one example (targeted at solvers that operate on correspondences between two views) that shows the "kernel" part of a robust fitting problem:

  1. The model; Mat3Model in the case of the F or H matrix.
  2. The minimum number of samples needed to fit; 7 or 8 (or 4).
  3. A way to convert samples to a model.
  4. A way to convert a sample and a model to an error.

Of particular note is that the kernel does not expose what the samples are. All the robust fitting algorithm sees is that there is some number of samples; it is able to fit subsets of them (via the kernel) and check their error, but can never access the samples themselves.

The Kernel objects must follow the following concept so that the robust fitting algorithm can fit this type of relation: ModelT

  1. kernel.getMaximumNbModels()
  2. kernel.getMinimumNbRequiredSamples()
  3. kernel.fit(std::vector<std::size_t>, std::vector<ModelT>&)
  4. kernel.error(std::size_t, ModelT) -> error

The fit routine must not clear existing entries in the vector of models; it should append new solutions to the end.

Member Function Documentation

◆ error()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
virtual double aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::error ( std::size_t  sample,
const ModelT &  model 
) const
inlinevirtual

◆ errors()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
virtual void aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::errors ( const ModelT &  model,
std::vector< double > &  errors 
) const
inlinevirtual

◆ fit()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
virtual void aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::fit ( const std::vector< std::size_t > &  samples,
std::vector< ModelT > &  models 
) const
inlinevirtual

◆ getMaximumNbModels()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
std::size_t aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::getMaximumNbModels ( ) const
inline

Return the maximum number of models.

Returns
maximum number of models

◆ getMinimumNbRequiredSamples()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
std::size_t aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::getMinimumNbRequiredSamples ( ) const
inline

Return the minimum number of required samples.

Returns
minimum number of required samples

◆ nbSamples()

template<typename SolverT_ , typename ErrorT_ , typename ModelT_ = Mat3Model>
std::size_t aliceVision::robustEstimation::PointFittingKernel< SolverT_, ErrorT_, ModelT_ >::nbSamples ( ) const
inline

get the number of putative points

Returns
number of putative points

The documentation for this class was generated from the following file: