summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/point-filter.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-03-28 23:19:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-03-29 00:04:46 +0200
commit0ee4dd997d17f57a5473443569548a8d2eaad779 (patch)
tree6242f37b12947594212de6276cbbdfcfafee1d08 /tracker-pt/point-filter.cpp
parentd8d63e65389c04e3725ae46231e50ec71e7040a9 (diff)
tracker/pt: add point filter deadzone
Diffstat (limited to 'tracker-pt/point-filter.cpp')
-rw-r--r--tracker-pt/point-filter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tracker-pt/point-filter.cpp b/tracker-pt/point-filter.cpp
index 7548d515..b03562ed 100644
--- a/tracker-pt/point-filter.cpp
+++ b/tracker-pt/point-filter.cpp
@@ -40,12 +40,14 @@ const PointOrder& point_filter::operator()(const PointOrder& input)
return A * pow((f)10, (f)-log10_pos) * rest;
);
- f dist = 0;
+ f dist = 0, dz = (float)s.point_filter_deadzone / 800; // sqrt(640^2 + 480^2)
for (unsigned i = 0; i < 3; i++)
{
vec2 tmp = input[i] - state_[i];
- dist = std::max(dist, sqrt(tmp.dot(tmp)));
+ f x = sqrt(tmp.dot(tmp));
+ x = std::max((f)0, x - dz);
+ dist = std::max(dist, x);
}
if (dist < (f)1e-6)