29#include "testing/testing.h"
54 EXPECT_MATRIX_PROP(F_gt, F, 1
e-6);
68 Mat normalized_points;
74 EXPECT_NEAR(0, mean(0), 1
e-8);
75 EXPECT_NEAR(0, mean(1), 1
e-8);
76 EXPECT_NEAR(2, variance(0), 1
e-8);
77 EXPECT_NEAR(2, variance(1), 1
e-8);
89 EXPECT_MATRIX_PROP(E_from_Rt, E_from_F, 1
e-6);
103 std::vector<Mat3> Rs;
104 std::vector<Vec3> ts;
106 bool one_solution_is_correct =
false;
107 for (
size_t i = 0; i < Rs.size(); ++i) {
109 one_solution_is_correct =
true;
113 EXPECT_TRUE(one_solution_is_correct);
127 std::vector<Mat3> Rs;
128 std::vector<Vec3> ts;
136 EXPECT_LE(0, solution);
137 EXPECT_LE(solution, 3);
160 E, d.
K1, x1, d.
K2, x2, &R_estimated, &t_estimated);
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
void EssentialFromRt(const Mat3 &R1, const Vec3 &t1, const Mat3 &R2, const Vec3 &t2, Mat3 *E)
void FundamentalFromProjections(const Mat34 &P1, const Mat34 &P2, Mat3 *F)
void PreconditionerFromPoints(const Mat &points, Mat3 *T)
double DistanceL2(const TVec &x, const TVec &y)
TwoViewDataSet TwoRealisticCameras(bool same_K)
TEST(PolynomialCameraIntrinsics2, ApplyOnFocalCenter)
double FrobeniusDistance(const TMat &A, const TMat &B)
void MatrixColumn(const Mat &A, int i, Vec2 *v)
void MeanAndVarianceAlongRows(const Mat &A, Vec *mean_pointer, Vec *variance_pointer)
void ProjectionsFromFundamental(const Mat3 &F, Mat34 *P1, Mat34 *P2)
void MotionFromEssential(const Mat3 &E, std::vector< Mat3 > *Rs, std::vector< Vec3 > *ts)
bool MotionFromEssentialAndCorrespondence(const Mat3 &E, const Mat3 &K1, const Vec2 &x1, const Mat3 &K2, const Vec2 &x2, Mat3 *R, Vec3 *t)
Eigen::Matrix< double, 3, 4 > Mat34
void ApplyTransformationToPoints(const Mat &points, const Mat3 &T, Mat *transformed_points)
int MotionFromEssentialChooseSolution(const std::vector< Mat3 > &Rs, const std::vector< Vec3 > &ts, const Mat3 &K1, const Vec2 &x1, const Mat3 &K2, const Vec2 &x2)
void EssentialFromFundamental(const Mat3 &F, const Mat3 &K1, const Mat3 &K2, Mat3 *E)
void RelativeCameraMotion(const Mat3 &R1, const Vec3 &t1, const Mat3 &R2, const Vec3 &t2, Mat3 *R, Vec3 *t)
double NormalizeL2(TVec *x)