From eb69cb7de343843880809f25457c0cb1698dffde Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 15 Oct 2013 15:21:41 +0000 Subject: Get rid of Allow Fallback option It was rather confusing from the user usage point of view and didn't get so much improvement after new bundle adjuster was added. In the future we might want to switch resection to PPnP algorithm, which could also might be a nice alternative to fallback option. --- .../libmv/libmv/multiview/euclidean_resection.cc | 26 +++++++--------------- 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'extern/libmv/libmv/multiview/euclidean_resection.cc') diff --git a/extern/libmv/libmv/multiview/euclidean_resection.cc b/extern/libmv/libmv/multiview/euclidean_resection.cc index d5421b9691e..b8c0a56005e 100644 --- a/extern/libmv/libmv/multiview/euclidean_resection.cc +++ b/extern/libmv/libmv/multiview/euclidean_resection.cc @@ -37,23 +37,21 @@ typedef unsigned int uint; bool EuclideanResectionPPnP(const Mat2X &x_camera, const Mat3X &X_world, - Mat3 *R, Vec3 *t, - double tolerance); + Mat3 *R, Vec3 *t); bool EuclideanResection(const Mat2X &x_camera, const Mat3X &X_world, Mat3 *R, Vec3 *t, - ResectionMethod method, - double success_threshold) { + ResectionMethod method) { switch (method) { case RESECTION_ANSAR_DANIILIDIS: EuclideanResectionAnsarDaniilidis(x_camera, X_world, R, t); break; case RESECTION_EPNP: - return EuclideanResectionEPnP(x_camera, X_world, R, t, success_threshold); + return EuclideanResectionEPnP(x_camera, X_world, R, t); break; case RESECTION_PPNP: - return EuclideanResectionPPnP(x_camera, X_world, R, t, success_threshold); + return EuclideanResectionPPnP(x_camera, X_world, R, t); break; default: LOG(FATAL) << "Unknown resection method."; @@ -444,8 +442,7 @@ static void ComputePointsCoordinatesInCameraFrame( bool EuclideanResectionEPnP(const Mat2X &x_camera, const Mat3X &X_world, - Mat3 *R, Vec3 *t, - double success_threshold) { + Mat3 *R, Vec3 *t) { CHECK(x_camera.cols() == X_world.cols()); CHECK(x_camera.cols() > 3); size_t num_points = X_world.cols(); @@ -553,13 +550,7 @@ bool EuclideanResectionEPnP(const Mat2X &x_camera, // // TODO(keir): Decide if setting this to infinity, effectively disabling the // check, is the right approach. So far this seems the case. - // - // TODO(sergey): Made it an option for now, in some cases it makes sense to - // still fallback to reprojection solution - // For details see bug [#32765] from Blender bug tracker - - // double kSuccessThreshold = std::numeric_limits::max(); - double kSuccessThreshold = success_threshold; + double kSuccessThreshold = std::numeric_limits::max(); // Find the first possible solution for R, t corresponding to: // Betas = [b00 b01 b11 b02 b12 b22 b03 b13 b23 b33] @@ -728,8 +719,7 @@ bool EuclideanResectionEPnP(const Mat2X &x_camera, // other hand, it did work on the first try. bool EuclideanResectionPPnP(const Mat2X &x_camera, const Mat3X &X_world, - Mat3 *R, Vec3 *t, - double tolerance) { + Mat3 *R, Vec3 *t) { int n = x_camera.cols(); Mat Z = Mat::Zero(n, n); Vec e = Vec::Ones(n); @@ -750,7 +740,7 @@ bool EuclideanResectionPPnP(const Mat2X &x_camera, Mat E(n, 3); int iteration = 0; - tolerance = 1e-5; + double tolerance = 1e-5; // TODO(keir): The limit of 100 can probably be reduced, but this will require // some investigation. while (error > tolerance && iteration < 100) { -- cgit v1.2.3 From dc46febec83fce671898251dcd69a283c73c4551 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 15 Oct 2013 15:21:44 +0000 Subject: Code cleanup: move function prototype to header file --- extern/libmv/libmv/multiview/euclidean_resection.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'extern/libmv/libmv/multiview/euclidean_resection.cc') diff --git a/extern/libmv/libmv/multiview/euclidean_resection.cc b/extern/libmv/libmv/multiview/euclidean_resection.cc index b8c0a56005e..245b027fb7c 100644 --- a/extern/libmv/libmv/multiview/euclidean_resection.cc +++ b/extern/libmv/libmv/multiview/euclidean_resection.cc @@ -34,10 +34,6 @@ namespace libmv { namespace euclidean_resection { typedef unsigned int uint; - -bool EuclideanResectionPPnP(const Mat2X &x_camera, - const Mat3X &X_world, - Mat3 *R, Vec3 *t); bool EuclideanResection(const Mat2X &x_camera, const Mat3X &X_world, -- cgit v1.2.3