[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60970] trunk/blender/extern/libmv/libmv/ tracking/track_region.cc: Fix bug where libmv tracking incorrectly succeeds on failure

Keir Mierle mierle at gmail.com
Mon Oct 28 19:34:19 CET 2013


Revision: 60970
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60970
Author:   keir
Date:     2013-10-28 18:34:19 +0000 (Mon, 28 Oct 2013)
Log Message:
-----------
Fix bug where libmv tracking incorrectly succeeds on failure

Before this patch, if Ceres returned USER_SUCCESS indicating that
Ceres was only changing the tracked quad slightly between
iterations (indicating convergence), no final correlation check
was done. This leads to incorrectly returning that the tracking
was successful, when it actually failed.

Modified Paths:
--------------
    trunk/blender/extern/libmv/libmv/tracking/track_region.cc

Modified: trunk/blender/extern/libmv/libmv/tracking/track_region.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/tracking/track_region.cc	2013-10-28 18:13:27 UTC (rev 60969)
+++ trunk/blender/extern/libmv/libmv/tracking/track_region.cc	2013-10-28 18:34:19 UTC (rev 60970)
@@ -1450,16 +1450,6 @@
     return;
   }
 
-  // This happens when the minimum corner shift tolerance is reached. Due to
-  // how the tolerance is computed this can't be done by Ceres. So return the
-  // same termination enum as Ceres, even though this is slightly different
-  // than Ceres's parameter tolerance, which operates on the raw parameter
-  // values rather than the pixel shifts of the patch corners.
-  if (summary.termination_type == ceres::USER_SUCCESS) {
-    result->termination = TrackRegionResult::PARAMETER_TOLERANCE;
-    return;
-  }
-
 #define HANDLE_TERMINATION(termination_enum) \
   if (summary.termination_type == ceres::termination_enum) { \
     result->termination = TrackRegionResult::termination_enum; \
@@ -1481,6 +1471,16 @@
     }
   }
 
+  // This happens when the minimum corner shift tolerance is reached. Due to
+  // how the tolerance is computed this can't be done by Ceres. So return the
+  // same termination enum as Ceres, even though this is slightly different
+  // than Ceres's parameter tolerance, which operates on the raw parameter
+  // values rather than the pixel shifts of the patch corners.
+  if (summary.termination_type == ceres::USER_SUCCESS) {
+    result->termination = TrackRegionResult::PARAMETER_TOLERANCE;
+    return;
+  }
+
   HANDLE_TERMINATION(PARAMETER_TOLERANCE);
   HANDLE_TERMINATION(FUNCTION_TOLERANCE);
   HANDLE_TERMINATION(GRADIENT_TOLERANCE);




More information about the Bf-blender-cvs mailing list