habemus triangulation
parent
12b10a358a
commit
02a0e70254
|
|
@ -220,6 +220,16 @@ class GTSAM_EXPORT SphericalCamera {
|
||||||
return Eigen::Matrix<double,traits<Point2>::dimension,1>::Constant(0.0);
|
return Eigen::Matrix<double,traits<Point2>::dimension,1>::Constant(0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @deprecated
|
||||||
|
size_t dim() const {
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @deprecated
|
||||||
|
static size_t Dim() {
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
|
|
|
||||||
|
|
@ -467,30 +467,30 @@ TEST( triangulation, twoPoses_sphericalCamera) {
|
||||||
EXPECT(assert_equal(landmark, point, 1e-7));
|
EXPECT(assert_equal(landmark, point, 1e-7));
|
||||||
|
|
||||||
// 3. Test simple DLT, now within triangulatePoint3
|
// 3. Test simple DLT, now within triangulatePoint3
|
||||||
// bool optimize = false;
|
bool optimize = false;
|
||||||
// boost::optional<Point3> actual1 = //
|
boost::optional<Point3> actual1 = //
|
||||||
// triangulatePoint3<SphericalCamera>(cameras, measurements, rank_tol, optimize);
|
triangulatePoint3<SphericalCamera>(cameras, measurements, rank_tol, optimize);
|
||||||
// EXPECT(assert_equal(landmark, *actual1, 1e-7));
|
EXPECT(assert_equal(landmark, *actual1, 1e-7));
|
||||||
//
|
|
||||||
// // 2. test with optimization on, same answer
|
// 4. test with optimization on, same answer
|
||||||
// optimize = true;
|
optimize = true;
|
||||||
// boost::optional<Point3> actual2 = //
|
boost::optional<Point3> actual2 = //
|
||||||
// triangulatePoint3(poses, sharedCal, measurements, rank_tol, optimize);
|
triangulatePoint3<SphericalCamera>(cameras, measurements, rank_tol, optimize);
|
||||||
// EXPECT(assert_equal(landmark, *actual2, 1e-7));
|
EXPECT(assert_equal(landmark, *actual2, 1e-7));
|
||||||
//
|
|
||||||
// // 3. Add some noise and try again: result should be ~ (4.995, 0.499167, 1.19814)
|
// 5. Add some noise and try again: result should be ~ (4.995, 0.499167, 1.19814)
|
||||||
// measurements.at(0) += Point2(0.1, 0.5);
|
measurements.at(0) = u1.retract(Vector2(0.01, 0.05)); //note: perturbation smaller for Unit3
|
||||||
// measurements.at(1) += Point2(-0.2, 0.3);
|
measurements.at(1) = u2.retract(Vector2(-0.02, 0.03));
|
||||||
// optimize = false;
|
optimize = false;
|
||||||
// boost::optional<Point3> actual3 = //
|
boost::optional<Point3> actual3 = //
|
||||||
// triangulatePoint3(poses, sharedCal, measurements, rank_tol, optimize);
|
triangulatePoint3<SphericalCamera>(cameras, measurements, rank_tol, optimize);
|
||||||
// EXPECT(assert_equal(Point3(4.995, 0.499167, 1.19814), *actual3, 1e-4));
|
EXPECT(assert_equal(Point3(5.94321,0.654327,1.48029), *actual3, 1e-4));
|
||||||
//
|
|
||||||
// // 4. Now with optimization on
|
// 6. Now with optimization on
|
||||||
// optimize = true;
|
optimize = true;
|
||||||
// boost::optional<Point3> actual4 = //
|
boost::optional<Point3> actual4 = //
|
||||||
// triangulatePoint3(poses, sharedCal, measurements, rank_tol, optimize);
|
triangulatePoint3<SphericalCamera>(cameras, measurements, rank_tol, optimize);
|
||||||
// EXPECT(assert_equal(Point3(4.995, 0.499167, 1.19814), *actual4, 1e-4));
|
EXPECT(assert_equal(Point3(5.94321,0.654327,1.48029), *actual4, 1e-4));
|
||||||
}
|
}
|
||||||
|
|
||||||
//******************************************************************************
|
//******************************************************************************
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue