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
diff options
context:
space:
mode:
authorKeir Mierle <mierle@gmail.com>2013-10-28 22:34:19 +0400
committerKeir Mierle <mierle@gmail.com>2013-10-28 22:34:19 +0400
commitd10abe6d4d6792bf0f9d6dbeed75acb9e46f210f (patch)
tree5cb0f38fed0e427cb5001ddf4ef5a2f435399f4b
parent869031f6be7632bda9202e631bd9349e2161c079 (diff)
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.
-rw-r--r--extern/libmv/libmv/tracking/track_region.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/extern/libmv/libmv/tracking/track_region.cc b/extern/libmv/libmv/tracking/track_region.cc
index 349d84b3817..786f16bf219 100644
--- a/extern/libmv/libmv/tracking/track_region.cc
+++ b/extern/libmv/libmv/tracking/track_region.cc
@@ -1450,16 +1450,6 @@ void TemplatedTrackRegion(const FloatImage &image1,
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 @@ void TemplatedTrackRegion(const FloatImage &image1,
}
}
+ // 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);