From b877020ab416e691e5681bd31ddcda373418678b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 19 Mar 2019 03:23:52 +0100 Subject: tracker/pt: call `reset_state()` consistently Issue: #910 --- tracker-pt/point_tracker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index ef70789a..a1d27ede 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -125,7 +125,7 @@ PointTracker::PointOrder PointTracker::find_correspondences_previous(const vec2* // if one point is closest to more than one model point, fallback if (point_taken[min_idx]) { - init_phase = true; + reset_state(); return find_correspondences(points, model); } point_taken[min_idx] = true; @@ -143,9 +143,9 @@ void PointTracker::track(const std::vector& points, const f fx = pt_camera_info::get_focal_length(info.fov, info.res_x, info.res_y); PointOrder order; - if (init_phase_timeout <= 0 || t.elapsed_ms() > init_phase_timeout || init_phase) + if (init_phase || init_phase_timeout <= 0 || t.elapsed_ms() > init_phase_timeout) { - init_phase = true; + reset_state(); order = find_correspondences(points.data(), model); } else -- cgit v1.2.3