diff options
Diffstat (limited to 'extern')
-rw-r--r-- | extern/libmv/libmv/simple_pipeline/bundle.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/extern/libmv/libmv/simple_pipeline/bundle.cc b/extern/libmv/libmv/simple_pipeline/bundle.cc index f068e050b48..17996f70def 100644 --- a/extern/libmv/libmv/simple_pipeline/bundle.cc +++ b/extern/libmv/libmv/simple_pipeline/bundle.cc @@ -83,6 +83,10 @@ struct OpenCVReprojectionError { x[1] += R_t[4]; x[2] += R_t[5]; + // Prevent points from going behind the camera. + if (x[2] < T(0)) + return false; + // Compute normalized coordinates: x /= x[2]. T xn = x[0] / x[2]; T yn = x[1] / x[2]; |