diff --git a/gtsam/geometry/CameraSet.h b/gtsam/geometry/CameraSet.h index dd58f8e69..ecdc7c007 100644 --- a/gtsam/geometry/CameraSet.h +++ b/gtsam/geometry/CameraSet.h @@ -141,18 +141,18 @@ public: return z; } - /// Calculate vector of re-projection errors + /// Calculate vector [z-project2(point)] of re-projection errors Vector reprojectionError(const Point3& point, const std::vector& measured, boost::optional Fs = boost::none, // boost::optional E = boost::none) const { - return ErrorVector(project2(point, Fs, E), measured); + return ErrorVector(measured, project2(point, Fs, E)); } - /// Calculate vector of re-projection errors, from point at infinity + /// Calculate vector [z-project2(point)] of re-projection errors, from point at infinity // TODO: take Unit3 instead Vector reprojectionErrorAtInfinity(const Point3& point, const std::vector& measured) const { - return ErrorVector(projectAtInfinity(point), measured); + return ErrorVector(measured, projectAtInfinity(point)); } /** diff --git a/gtsam/geometry/tests/testCameraSet.cpp b/gtsam/geometry/tests/testCameraSet.cpp index 05ffc275c..f34809ae6 100644 --- a/gtsam/geometry/tests/testCameraSet.cpp +++ b/gtsam/geometry/tests/testCameraSet.cpp @@ -75,7 +75,7 @@ TEST(CameraSet, Pinhole) { Vector4 expectedV; // reprojectionError - expectedV << -1, -2, -3, -4; + expectedV << 1, 2, 3, 4; Vector actualV = set.reprojectionError(p, measured); EXPECT(assert_equal(expectedV, actualV)); diff --git a/gtsam/geometry/tests/testPinholeSet.cpp b/gtsam/geometry/tests/testPinholeSet.cpp index 1e5426f33..a8e43003d 100644 --- a/gtsam/geometry/tests/testPinholeSet.cpp +++ b/gtsam/geometry/tests/testPinholeSet.cpp @@ -115,7 +115,7 @@ TEST(PinholeSet, Pinhole) { Vector4 expectedV; // reprojectionError - expectedV << -1, -2, -3, -4; + expectedV << 1, 2, 3, 4; Vector actualV = set.reprojectionError(p, measured); EXPECT(assert_equal(expectedV, actualV));