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>2014-01-28 16:01:03 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-01-28 16:02:22 +0400
commitbe6643b5ec01c8f64a1065762c38ce8803b717c0 (patch)
treeec8ffa055277aba2b1fecc636efde0a84140fc35 /extern
parentc2da706a36ca355509d9dc2abcffc1edc6c49fff (diff)
Followup to the previous commit
Need to take weight into account when drawing per-frame track reprojection curve and when computing per-track average error.
Diffstat (limited to 'extern')
-rw-r--r--extern/libmv/libmv-capi.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/extern/libmv/libmv-capi.cc b/extern/libmv/libmv-capi.cc
index 9a536f718aa..5bc159c64af 100644
--- a/extern/libmv/libmv-capi.cc
+++ b/extern/libmv/libmv-capi.cc
@@ -760,18 +760,19 @@ double libmv_reprojectionErrorForTrack(const struct libmv_Reconstruction *libmv_
double total_error = 0.0;
for (int i = 0; i < markers.size(); ++i) {
+ double weight = markers[i].weight;
const libmv::EuclideanCamera *camera = reconstruction->CameraForImage(markers[i].image);
const libmv::EuclideanPoint *point = reconstruction->PointForTrack(markers[i].track);
- if (!camera || !point) {
+ if (!camera || !point || weight == 0.0) {
continue;
}
num_reprojected++;
libmv::Marker reprojected_marker = ProjectMarker(*point, *camera, *intrinsics);
- double ex = reprojected_marker.x - markers[i].x;
- double ey = reprojected_marker.y - markers[i].y;
+ double ex = (reprojected_marker.x - markers[i].x) * weight;
+ double ey = (reprojected_marker.y - markers[i].y) * weight;
total_error += sqrt(ex * ex + ey * ey);
}