diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-19 03:23:52 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-19 03:23:52 +0100 |
commit | b877020ab416e691e5681bd31ddcda373418678b (patch) | |
tree | 23460c8a37c9c982c1ad1a83a5e5019d006dbae4 /tracker-pt | |
parent | f6ddd7f9f44a4deccdb3d441aa00e37818eb5d3b (diff) |
tracker/pt: call `reset_state()` consistently
Issue: #910
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/point_tracker.cpp | 6 |
1 files 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<vec2>& 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 |