 |
AliceVision
Photogrammetric Computer Vision Framework
|
11 #include <aliceVision/robustEstimation/conditioning.hpp>
12 #include <aliceVision/robustEstimation/PointFittingKernel.hpp>
13 #include <aliceVision/multiview/relativePose/Essential5PSolver.hpp>
14 #include <aliceVision/multiview/relativePose/Essential8PSolver.hpp>
15 #include <aliceVision/multiview/relativePose/FundamentalError.hpp>
16 #include <aliceVision/multiview/essential.hpp>
17 #include <aliceVision/multiview/Unnormalizer.hpp>
21 namespace relativePose {
29 template<
typename SolverT,
typename ErrorT,
typename ModelT = robustEstimation::Mat3Model>
35 EssentialKernel(
const Mat& x1,
const Mat& x2,
const Mat3& K1,
const Mat3& K2)
41 void fit(
const std::vector<std::size_t>& samples, std::vector<ModelT>& models)
const override
46 assert(2 == x1.rows());
48 assert(x1.rows() == x2.rows());
49 assert(x1.cols() == x2.cols());
52 const Mat3 K1Inverse = _K1.inverse();
53 const Mat3 K2Inverse = _K2.inverse();
58 robustEstimation::applyTransformationToPoints(x1, K1Inverse, &x1_normalized);
59 robustEstimation::applyTransformationToPoints(x2, K2Inverse, &x2_normalized);
80 typedef EssentialKernel<Essential8PSolver, FundamentalSampsonError, robustEstimation::Mat3Model> Essential8PKernel;
85 typedef EssentialKernel<Essential5PSolver, FundamentalSampsonError, robustEstimation::Mat3Model> Essential5PKernel;
This is one example (targeted at solvers that operate on correspondences between two views) that show...
Definition: PointFittingKernel.hpp:48
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: EssentialKernel.hpp:41
double error(std::size_t sample, const ModelT &model) const
Return the error associated to the model and a sample point.
Definition: EssentialKernel.hpp:64
Generic Solver for the 5pt Essential Matrix Estimation.
Definition: EssentialKernel.hpp:30
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
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
const Mat & _x1
left corresponding data
Definition: PointFittingKernel.hpp:115
void fundamentalFromEssential(const Mat3 &E, const Mat3 &K1, const Mat3 &K2, Mat3 *F)
Given E, Left/Right K matrix it compute the Fundamental matrix.
Definition: essential.cpp:21