MCPcopy Create free account
hub / github.com/colmap/colmap / TEST

Function TEST

src/colmap/geometry/essential_matrix_test.cc:43–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41namespace {
42
43TEST(DecomposeEssentialMatrix, Nominal) {
44 const Rigid3d cam2_from_cam1(Eigen::Quaterniond::UnitRandom(),
45 Eigen::Vector3d(0.5, 1, 1).normalized());
46 const Eigen::Matrix3d cam2_from_cam1_rot_mat =
47 cam2_from_cam1.rotation().toRotationMatrix();
48 const Eigen::Matrix3d E = EssentialMatrixFromPose(cam2_from_cam1);
49
50 Eigen::Matrix3d R1;
51 Eigen::Matrix3d R2;
52 Eigen::Vector3d t;
53 DecomposeEssentialMatrix(E, &R1, &R2, &t);
54
55 EXPECT_TRUE((R1 - cam2_from_cam1_rot_mat).norm() < 1e-10 ||
56 (R2 - cam2_from_cam1_rot_mat).norm() < 1e-10);
57 EXPECT_TRUE((t - cam2_from_cam1.translation()).norm() < 1e-10 ||
58 (t + cam2_from_cam1.translation()).norm() < 1e-10);
59}
60
61TEST(EssentialMatrixFromPose, Nominal) {
62 EXPECT_EQ(EssentialMatrixFromPose(Rigid3d(Eigen::Quaterniond::Identity(),

Callers

nothing calls this directly

Calls 15

EssentialMatrixFromPoseFunction · 0.85
DecomposeEssentialMatrixFunction · 0.85
Rigid3dClass · 0.85
PoseFromEssentialMatrixFunction · 0.85
Rigid3dNearFunction · 0.85
EigenMatrixNearFunction · 0.85
InvertEssentialMatrixFunction · 0.85

Tested by

no test coverage detected