21#ifndef LIBMV_MULTIVIEW_HOMOGRAPHY_ERRORS_H_
22#define LIBMV_MULTIVIEW_HOMOGRAPHY_ERRORS_H_
28namespace homography2D {
51 dx->resize(2, x1.cols());
58 dx->row(0) = x2h_est.row(0).array() / x2h_est.row(2).array();
59 dx->row(1) = x2h_est.row(1).array() / x2h_est.row(2).array();
86 *dx = x2 - x2h_est.head<2>() / x2h_est[2];
89 x2h_est.head<2>() / x2h_est[2];
107 return dx.squaredNorm();
123 return dx.squaredNorm();
150 Mat3 Hinv =
H.inverse();
177 dx->resize(3, x1.cols());
179 for (
int i = 0; i < x1.cols(); ++i) {
197 if (x1.rows() == 2) {
202 if (x2.rows() == 2) {
224 return dx.squaredNorm();
240 return dx.squaredNorm();
void EuclideanToHomogeneous(const Mat &X, Mat *H)
Eigen::Matrix< double, 3, 3 > Mat3
void HomogeneousToEuclidean(const Mat &H, Mat *X)
Mat3 SkewMat(const Vec3 &x)
Returns the skew anti-symmetric matrix of a vector.
Eigen::Matrix< double, 3, Eigen::Dynamic > Mat3X
Eigen::Matrix< double, 2, Eigen::Dynamic > Mat2X
static void Residuals(const Mat &H, const Mat &x1, const Mat &x2, Mat3X *dx)
static double Error(const Mat &H, const Mat &x1, const Mat &x2)
static void Residuals(const Mat &H, const Vec &x1, const Vec &x2, Vec3 *dx)
static double Error(const Mat &H, const Vec &x1, const Vec &x2)
static double Error(const Mat &H, const Vec &x1, const Vec &x2)
static void Residuals(const Mat &H, const Mat &x1, const Mat &x2, Mat2X *dx)
static double Error(const Mat &H, const Mat &x1, const Mat &x2)
static void Residuals(const Mat &H, const Vec &x1, const Vec &x2, Vec2 *dx)
static double Error(const Mat &H, const Vec &x1, const Vec &x2)