From be6643b5ec01c8f64a1065762c38ce8803b717c0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 28 Jan 2014 18:01:03 +0600 Subject: 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. --- extern/libmv/libmv-capi.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'extern') 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); } -- cgit v1.2.3