diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-03-06 09:13:49 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-03-07 00:35:38 +0100 |
commit | a40a557caddad5285bd03b79dca5f7a94d1f44c5 (patch) | |
tree | a6130327881588aa69f87d84ed56beeb5328eb10 /tracker-pt | |
parent | 611a6df71f8ec2a0f742ad09a89668f684806d39 (diff) |
tracker/pt: don't use exact float comparison in POSIT
Diffstat (limited to 'tracker-pt')
-rw-r--r-- | tracker-pt/point_tracker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index 599ce2d3..25240635 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -194,7 +194,7 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order_, float float IJ0 = I0.dot(J0); float JJ0 = J0.dot(J0); float rho, theta; - if (JJ0 == II0) { + if (std::abs(JJ0 - II0) < 1e-6f) { rho = std::sqrt(std::abs(2*IJ0)); theta = -PI/4; if (IJ0<0) theta *= -1; |