rename to reprojectionErrorAfterTriangulation

release/4.3a0
dellaert 2015-02-25 01:14:36 +01:00
parent 694e6e903c
commit d7b5156dcc
3 changed files with 7 additions and 11 deletions

View File

@ -571,17 +571,11 @@ public:
} }
/// Calculate vector of re-projection errors, before applying noise model /// Calculate vector of re-projection errors, before applying noise model
/// Assumes triangulation was done and degeneracy handled Vector reprojectionErrorAfterTriangulation(const Values& values) const {
Vector reprojectionError(const Cameras& cameras) const {
return cameras.reprojectionError(point_,this->measured_);
}
/// Calculate vector of re-projection errors, before applying noise model
Vector reprojectionError(const Values& values) const {
Cameras cameras; Cameras cameras;
bool nonDegenerate = computeCamerasAndTriangulate(values, cameras); bool nonDegenerate = computeCamerasAndTriangulate(values, cameras);
if (nonDegenerate) if (nonDegenerate)
return reprojectionError(cameras); return Base::reprojectionError(cameras, point_);
else else
return zero(cameras.size() * 2); return zero(cameras.size() * 2);
} }

View File

@ -136,7 +136,9 @@ TEST( SmartProjectionCameraFactor, noiseless ) {
double expectedError = 0.0; double expectedError = 0.0;
DOUBLES_EQUAL(expectedError, factor1->error(values), 1e-7); DOUBLES_EQUAL(expectedError, factor1->error(values), 1e-7);
CHECK(assert_equal(zero(4), factor1->reprojectionError(values), 1e-7)); CHECK(
assert_equal(zero(4),
factor1->reprojectionErrorAfterTriangulation(values), 1e-7));
} }
/* *************************************************************************/ /* *************************************************************************/

View File

@ -625,11 +625,11 @@ public:
} }
/// Calculate vector of re-projection errors, before applying noise model /// Calculate vector of re-projection errors, before applying noise model
Vector reprojectionError(const Values& values) const { Vector reprojectionErrorAfterTriangulation(const Values& values) const {
Cameras cameras; Cameras cameras;
bool nonDegenerate = computeCamerasAndTriangulate(values, cameras); bool nonDegenerate = computeCamerasAndTriangulate(values, cameras);
if (nonDegenerate) if (nonDegenerate)
return cameras.reprojectionError(point_); return Base::reprojectionError(cameras, point_);
else else
return zero(cameras.size() * 3); return zero(cameras.size() * 3);
} }