Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-05-09 20:38:58 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-05-09 20:38:58 +0400
commited131e67c49291760df42c3eb3096762fd515be8 (patch)
treea58af7a6950872b44d444b4f645ad5dea4198185 /extern
parent97138e4dacab2187a76dd06b6dc100a30548ee20 (diff)
Add check for points behind camera in euclidan BA cost functor
In cases keyframes are no so good, algebraic two frames construction could produce result, for which more aggressive Ceres-based BA code will fall to a solution for which points goes behind the camera, which is not so nice. Seems in newer Ceres returning false from cost functor wouldn't abort solution, but will restrict solver from moving points behind the camera. Works fine in own tests, but requires more tests.
Diffstat (limited to 'extern')
-rw-r--r--extern/libmv/libmv/simple_pipeline/bundle.cc4
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];