summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/pt-api.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-12 19:40:22 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-12 19:40:22 +0100
commit537a88e522314753149e1ea7921489e58043b40c (patch)
treea62ac59a546c8b0ee8adeee3bd2aa255d7e4570e /tracker-pt/pt-api.cpp
parent11d8e48e4370c9201f8258b418aadc7a4290dba1 (diff)
tracker/pt: isolate point extractor and image type
Issue: #718
Diffstat (limited to 'tracker-pt/pt-api.cpp')
-rw-r--r--tracker-pt/pt-api.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tracker-pt/pt-api.cpp b/tracker-pt/pt-api.cpp
index c11f372f..0a6c8e2b 100644
--- a/tracker-pt/pt-api.cpp
+++ b/tracker-pt/pt-api.cpp
@@ -60,3 +60,22 @@ double pt_point_extractor::threshold_radius_value(int w, int h, int threshold)
return radius;
}
+
+
+std::tuple<double, double> pt_pixel_pos_mixin::to_pixel_pos(double x, double y, int w, int h)
+{
+ return std::make_tuple(w*(x+.5), .5*(h - 2*y*w));
+}
+
+std::tuple<double, double> pt_pixel_pos_mixin::to_screen_pos(double px, double py, int w, int h)
+{
+ return std::make_tuple((px - w/2.)/w, -(py - h/2.)/w);
+}
+
+pt_frame::pt_frame()
+{
+}
+
+pt_frame::~pt_frame()
+{
+}