32 #define TEST_NAME "estimators/coordinate_frame"
43 Eigen::Vector3d::Zero());
48 std::string image_path;
51 reconstruction, image_path),
52 Eigen::Matrix3d::Zero());
65 image.Qvec() = Eigen::Vector4d(1.0, 0.0, 0.0, 0.0);
66 image.Tvec() = Eigen::Vector3d(-1.0, 0.0, 0.0);
80 const bool inverted = tform.
Rotation()(2) < 0;
83 BOOST_CHECK_LE((reconstruction.
Point3D(p1).
XYZ() -
84 Eigen::Vector3d(inverted ? 1.0 : -1.0, 0.0, 0.0))
87 BOOST_CHECK_LE((reconstruction.
Point3D(p2).
XYZ() -
88 Eigen::Vector3d(inverted ? -1.0 : 1.0, 0.0, 0.0))
91 BOOST_CHECK_LE((reconstruction.
Point3D(p3).
XYZ() -
92 Eigen::Vector3d(0.0, inverted ? 1.0 : -1.0, 0.0))
95 BOOST_CHECK_LE((reconstruction.
Point3D(p4).
XYZ() -
96 Eigen::Vector3d(0.0, inverted ? -1.0 : 1.0, 0.0))
101 Eigen::Vector3d(0.0, 0.0, 1.0))
107 mat << 0, -1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 1;
109 mat << 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1;
112 BOOST_CHECK_LE((tform.
Matrix() - mat).norm(), 1
e-6);
120 {Eigen::Vector3d(50, 10.1, 100), Eigen::Vector3d(50.1, 10, 100),
121 Eigen::Vector3d(50.1, 10.1, 100), Eigen::Vector3d(50, 10, 100)});
124 std::vector<point3D_t> point_ids;
125 for (
size_t i = 0; i <
points.size(); ++i) {
131 BOOST_CHECK_LE((reconstruction.
Point3D(point_ids[0]).
XYZ() -
132 Eigen::Vector3d(3584.8565215, -5561.5336506, 0.0742643))
135 BOOST_CHECK_LE((reconstruction.
Point3D(point_ids[1]).
XYZ() -
136 Eigen::Vector3d(-3577.3888622, 5561.6397107, 0.0783761))
139 BOOST_CHECK_LE((reconstruction.
Point3D(point_ids[2]).
XYZ() -
140 Eigen::Vector3d(3577.4152111, 5561.6397283, 0.0783613))
143 BOOST_CHECK_LE((reconstruction.
Point3D(point_ids[3]).
XYZ() -
144 Eigen::Vector3d(-3584.8301178, -5561.5336683, 0.0742791))
149 for (
size_t i = 1; i <
points.size(); ++i) {
150 const double dist_orig = (
points[i] -
points[i - 1]).norm();
151 const double dist_tform = (reconstruction.
Point3D(point_ids[i]).
XYZ() -
152 reconstruction.
Point3D(point_ids[i - 1]).
XYZ())
154 BOOST_CHECK_LE(std::abs(dist_orig - dist_tform), 1
e-6);
std::shared_ptr< core::Tensor > image
Eigen::Vector3d ProjectionCenter() const
const Eigen::Vector3d & XYZ() const
void AddImage(const class Image &image)
const class Image & Image(const image_t image_id) const
const class Point3D & Point3D(const point3D_t point3D_id) const
point3D_t AddPoint3D(const Eigen::Vector3d &xyz, const Track &track, const Eigen::Vector3ub &color=Eigen::Vector3ub::Zero())
BOOST_AUTO_TEST_CASE(TestEstimateGravityVectorFromImageOrientation)
QTextStream & endl(QTextStream &stream)
Eigen::Matrix3d EstimateManhattanWorldFrame(const ManhattanWorldFrameEstimationOptions &options, const Reconstruction &reconstruction, const std::string &image_path)
Eigen::Vector3d EstimateGravityVectorFromImageOrientation(const Reconstruction &reconstruction, const double max_axis_distance)
void AlignToENUPlane(Reconstruction *recon, SimilarityTransform3 *tform, bool unscaled)
void AlignToPrincipalPlane(Reconstruction *recon, SimilarityTransform3 *tform)