 |
AliceVision
Photogrammetric Computer Vision Framework
|
11 #include <aliceVision/numeric/numeric.hpp>
12 #include <aliceVision/robustEstimation/conditioning.hpp>
13 #include <aliceVision/robustEstimation/ISolver.hpp>
19 namespace robustEstimation {
47 template<
typename SolverT_,
typename ErrorT_,
typename ModelT_ = Mat3Model>
51 using SolverT = SolverT_;
52 using ErrorT = ErrorT_;
53 using ModelT = ModelT_;
77 inline virtual void fit(
const std::vector<std::size_t>& samples, std::vector<ModelT>& models)
const
90 inline virtual double error(std::size_t sample,
const ModelT& model)
const
103 for (std::size_t sample = 0; sample <
_x1.cols(); ++sample)
124 template<
typename SolverT_,
typename ErrorT_,
typename UnnormalizerT_,
typename ModelT_ = Mat3Model>
139 inline void fit(
const std::vector<std::size_t>& samples, std::vector<ModelT_>& models)
const override
144 assert(2 == x1.rows());
146 assert(x1.rows() == x2.rows());
147 assert(x1.cols() == x2.cols());
155 normalizePoints(x1, &x1_normalized, &T1);
156 normalizePoints(x2, &x2_normalized, &T2);
161 for (
int i = 0; i < models.size(); ++i)
162 UnnormalizerT_::unnormalize(T1, T2, &(models.at(i).getMatrix()));
This is one example (targeted at solvers that operate on correspondences between two views) that show...
Definition: PointFittingKernel.hpp:48
virtual void errors(const ModelT &model, std::vector< double > &errors) const
Return the errors associated to the model and each sample point.
Definition: PointFittingKernel.hpp:100
TMat buildSubsetMatrix(const TMat &A, const TCols &columns)
It extracts the columns of given indices from the given matrix.
Definition: Container.hpp:124
const SolverT _kernelSolver
two view solver
Definition: PointFittingKernel.hpp:119
std::size_t getMinimumNbRequiredSamples() const
Return the minimum number of required samples.
Definition: PointFittingKernel.hpp:64
Definition: checkerDetector.cpp:32
std::size_t getMaximumNbModels() const
Return the maximum number of models.
Definition: PointFittingKernel.hpp:70
std::size_t nbSamples() const
get the number of putative points
Definition: PointFittingKernel.hpp:111
Matrix based model to be used in a solver.
Definition: ISolver.hpp:88
const Mat & _x2
right corresponding data
Definition: PointFittingKernel.hpp:117
const ErrorT _errorEstimator
solver error estimation
Definition: PointFittingKernel.hpp:121
virtual double error(std::size_t sample, const ModelT &model) const
Return the error associated to the model and a sample point.
Definition: PointFittingKernel.hpp:90
const Mat & _x1
left corresponding data
Definition: PointFittingKernel.hpp:115
void fit(const std::vector< std::size_t > &samples, std::vector< ModelT_ > &models) const override
Extract required sample and fit model(s) to the sample.
Definition: PointFittingKernel.hpp:139
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.
Definition: PointFittingKernel.hpp:77
Definition: PointFittingKernel.hpp:125