summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-10-17 14:30:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-10-17 15:20:01 +0200
commit1a31ec8b8a4abb1c82317ae500998fc8228a50f8 (patch)
tree9cd7143cc267d8b24f0b183312434442e024359b /tracker-pt/module
parent87b97e24d1bfd6bd57afd3c893a3be2bf47252e6 (diff)
tracker/pt: display points as ellipses
Diffstat (limited to 'tracker-pt/module')
-rw-r--r--tracker-pt/module/point_extractor.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp
index e679e7fc..be4823ad 100644
--- a/tracker-pt/module/point_extractor.cpp
+++ b/tracker-pt/module/point_extractor.cpp
@@ -250,14 +250,13 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob
cv::Point p(iround(b.pos[0] * cx), iround(b.pos[1] * cy));
- auto circle_color = k >= PointModel::N_POINTS
- ? cv::Scalar(192, 192, 192)
- : cv::Scalar(255, 255, 0);
+ auto outline_color = k >= PointModel::N_POINTS
+ ? cv::Scalar(192, 192, 192)
+ : cv::Scalar(255, 255, 0);
- const int overlay_size = iround(dpi);
-
- cv::circle(preview_frame, p, iround((b.radius + f(2)) * c),
- circle_color, overlay_size, cv::LINE_AA);
+ cv::ellipse(preview_frame, p,
+ {iround(b.rect.width/(f)2+2*c), iround(b.rect.height/(f)2+2*c)},
+ 0, 0, 360, outline_color, iround(dpi), cv::LINE_AA);
char buf[16];
std::snprintf(buf, sizeof(buf), "%.2fpx", (double)b.radius);
@@ -268,7 +267,7 @@ static void draw_blobs(cv::Mat& preview_frame, const blob* blobs, unsigned nblob
cv::Point pos(iround(b.pos[0]*cx+offx), iround(b.pos[1]*cy+offy));
cv::putText(preview_frame, buf, pos,
- cv::FONT_HERSHEY_PLAIN, overlay_size, text_color,
+ cv::FONT_HERSHEY_PLAIN, iround(dpi), text_color,
1);
}
}