summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-12-10 06:26:43 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-12-10 06:26:43 +0100
commit714a665e6f1c92a02d817b2f2f41254ce03280bc (patch)
tree8cad41511ede78c9455775a0a3a1cd95989aa134 /tracker-pt
parenta26f0a51ccc21067dbacf6f9f5bcd8d4fe6dd15e (diff)
tracker/pt: make overlay look more of the same on 320x240 as 640x480
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp8
-rw-r--r--tracker-pt/point_extractor.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index d0f65e7b..31d3cb14 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -139,8 +139,8 @@ void Tracker_PT::run()
using std::max;
static constexpr int frame_size = 400;
- const int size = max(1, iround(sqrt(frame.rows*frame.rows + frame.cols*frame.cols) / frame_size));
- const int len = size * 10;
+ const double size = max(1., 1.5*sqrt(frame.rows*frame.rows + frame.cols*frame.cols) / frame_size);
+ const int len = std::max(1, iround(size * 7.5));
cv::Point p2(int(round(p[0] * frame_.cols + frame_.cols/2)),
int(round(-p[1] * frame_.cols + frame_.rows/2)));
@@ -148,12 +148,12 @@ void Tracker_PT::run()
cv::Point(p2.x - len, p2.y),
cv::Point(p2.x + len, p2.y),
color,
- 2);
+ iround(size/2));
cv::line(frame_,
cv::Point(p2.x, p2.y - len),
cv::Point(p2.x, p2.y + len),
color,
- 2);
+ iround(size/2));
};
for (unsigned i = 0; i < points.size(); i++)
diff --git a/tracker-pt/point_extractor.cpp b/tracker-pt/point_extractor.cpp
index d18ba513..a688faad 100644
--- a/tracker-pt/point_extractor.cpp
+++ b/tracker-pt/point_extractor.cpp
@@ -197,7 +197,7 @@ void PointExtractor::extract_points(cv::Mat& frame, std::vector<vec2>& points)
blobs.push_back(b);
static constexpr int frame_size = 400;
- const int size = std::max(1, iround(std::sqrt(frame.rows*frame.rows + frame.cols*frame.cols) / frame_size));
+ const double size = std::max(1, iround(std::sqrt(frame.rows*frame.rows + frame.cols*frame.cols) / frame_size));
{
char buf[64];
@@ -208,7 +208,7 @@ void PointExtractor::extract_points(cv::Mat& frame, std::vector<vec2>& points)
cv::FONT_HERSHEY_PLAIN,
size,
cv::Scalar(0, 0, 255),
- 2);
+ iround(size));
}
if (idx >= max_blobs) goto end;