21#ifndef LIBMV_MULTIVIEW_TWO_VIEW_KERNEL_H_
22#define LIBMV_MULTIVIEW_TWO_VIEW_KERNEL_H_
33template <
typename Solver,
typename Unnormalizer>
37 assert(2 == x1.rows());
39 assert(x1.rows() == x2.rows());
40 assert(x1.cols() == x2.cols());
44 Mat x1_normalized, x2_normalized;
48 Solver::Solve(x1_normalized, x2_normalized, models);
50 for (
int i = 0; i < models->size(); ++i) {
51 Unnormalizer::Unnormalize(
T1,
T2, &(*models)[i]);
56template <
typename Solver,
typename Unnormalizer>
60 assert(2 == x1.rows());
62 assert(x1.rows() == x2.rows());
63 assert(x1.cols() == x2.cols());
67 Mat x1_normalized, x2_normalized;
71 Solver::Solve(x1_normalized, x2_normalized, models);
73 for (
int i = 0; i < models->size(); ++i) {
74 Unnormalizer::Unnormalize(
T1,
T2, &(*models)[i]);
102template <
typename SolverArg,
typename ErrorArg,
typename ModelArg = Mat3>
112 Solver::Solve(x1, x2, models);
115 return ErrorArg::Error(model,
122 Solver::Solve(x1, x2, models);
static void Solve(const Mat &x1, const Mat &x2, vector< Model > *models)
double Error(int sample, const Model &model) const
Kernel(const Mat &x1, const Mat &x2)
void Fit(const vector< int > &samples, vector< Model > *models) const
void NormalizePoints(const Mat &points, Mat *normalized_points, Mat3 *T)
Eigen::Matrix< double, 3, 3 > Mat3
void NormalizeIsotropicPoints(const Mat &points, Mat *normalized_points, Mat3 *T)
std::vector< ElementType, Eigen::aligned_allocator< ElementType > > vector
TMat ExtractColumns(const TMat &A, const TCols &columns)
static void Solve(const Mat &x1, const Mat &x2, vector< Mat3 > *models)
static void Solve(const Mat &x1, const Mat &x2, vector< Mat3 > *models)