Fix bug to calcuate current data to previous data gaze_devel
authorTae-Young Chung <ty83.chung@samsung.com>
Wed, 3 Jul 2024 05:03:26 +0000 (14:03 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Wed, 3 Jul 2024 05:04:02 +0000 (14:04 +0900)
Change-Id: I3487224838ff49cd877766d74bfa6fe36c74f560
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
inference/backends/private/src/PointsTracker.cpp
inference/backends/private/src/RectsTracker.cpp

index ace9fa917e7007163e959e3d5c89bf341f04fb85..9c807858db605dd8165d46a9e582bc7f3050194b 100644 (file)
@@ -27,7 +27,7 @@ namespace inference
 PointsTracker::PointsTracker(const int numbers) : AbstractTracker(numbers)
 {
     _numberOfPoints = numbers;
-    _distanceThresValue = sqrt(2.f);
+    _distanceThresValue = sqrt(2.f*(2.0f * 2.0f));
 }
 
 PointsTracker::~PointsTracker()
@@ -86,7 +86,8 @@ vector<Point> &PointsTracker::update(vector<Point> &points)
         _filters[index]->update(point.x, point.y);
         auto newPoint = _filters[index]->get();
 
-        if (distanceValue({static_cast<float>(point.x), static_cast<float>(point.y)}, newPoint) <= _distanceThresValue) {
+        if (distanceValue({static_cast<float>(point.x), static_cast<float>(point.y)},
+                         {static_cast<float>(_points[index].x), static_cast<float>(_points[index].y)}) <= _distanceThresValue) {
             _filters[index]->update(_points[index].x, _points[index].y);
         } else {
             _points[index].x = static_cast<int>(get<0>(newPoint));
index 3797975a81d975d7fd647757b0fae966f22156dc..658789423991015e0f81f17b2a2eba24d24c79b0 100644 (file)
@@ -27,7 +27,7 @@ namespace inference
 RectsTracker::RectsTracker(const int numbers) : AbstractTracker(numbers * 2)
 {
     _numberOfRects = numbers;
-    _iouThresValue = 0.95;
+    _iouThresValue = 0.93;
 }
 
 RectsTracker::~RectsTracker()
@@ -112,8 +112,14 @@ vector<Rect> &RectsTracker::update(vector<Rect> &rects)
         auto newRB = _filters[filterIndex]->get();
         filterIndex++;
 
-        if (iouValue({rect.left, rect.top}, {rect.right, rect.bottom}, newLT, newRB) >= _iouThresValue) {
-            SINGLEO_LOGI("iou: %.4f", iouValue({rect.left, rect.top}, {rect.right, rect.bottom}, newLT, newRB));
+        // if (iouValue({_rects[rectIndex].left, _rects[rectIndex].top},
+        //              {_rects[rectIndex].right, _rects[rectIndex].bottom},
+        //              newLT, newRB) >= _iouThresValue) {
+        if (iouValue({_rects[rectIndex].left, _rects[rectIndex].top},
+                     {_rects[rectIndex].right, _rects[rectIndex].bottom},
+                     { rect.left, rect.top},
+                     { rect.right, rect.bottom}) >= _iouThresValue) {
+
             filterIndex--;
             filterIndex--;