diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-12 19:40:22 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-12 19:40:22 +0100 |
commit | 537a88e522314753149e1ea7921489e58043b40c (patch) | |
tree | a62ac59a546c8b0ee8adeee3bd2aa255d7e4570e /tracker-pt/pt-api.cpp | |
parent | 11d8e48e4370c9201f8258b418aadc7a4290dba1 (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.cpp | 19 |
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() +{ +} |