From 302dfd055bd368752216701a0d0e963d5bf6d3e9 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 12 Jan 2014 19:53:59 +0100 Subject: Revert "remove hack of passing fov/w/h as member vars" This reverts commit 6e1610667fb33517299997e628652fd91380e762. --- FTNoIR_Tracker_PT/point_tracker.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'FTNoIR_Tracker_PT/point_tracker.h') diff --git a/FTNoIR_Tracker_PT/point_tracker.h b/FTNoIR_Tracker_PT/point_tracker.h index 741d5af4..ac43489e 100644 --- a/FTNoIR_Tracker_PT/point_tracker.h +++ b/FTNoIR_Tracker_PT/point_tracker.h @@ -98,12 +98,16 @@ public: FrameTrafo get_pose() const { return X_CM; } void reset(); + float fov; + int _w, _h; + protected: - cv::Vec2f project(const cv::Vec3f& v_M, float fov, int w, int h) + cv::Vec2f project(const cv::Vec3f& v_M) { if (!rvec.empty() && !tvec.empty() && fov > 0) { const float HT_PI = 3.1415926535; + const int w = _w, h = _h; const float focal_length_w = 0.5 * w / tan(fov * HT_PI / 180); const float focal_length_h = 0.5 * h / tan(fov * h / w * HT_PI / 180.0); @@ -122,7 +126,7 @@ protected: return cv::Vec2f(); } - bool find_correspondences(const std::vector& points, float fov, int w, int h); + bool find_correspondences(const std::vector& points); cv::Vec2f p[PointModel::N_POINTS]; // the points in model order cv::Vec2f p_exp[PointModel::N_POINTS]; // the expected point positions -- cgit v1.2.3