summaryrefslogtreecommitdiffhomepage
path: root/FTNoIR_Tracker_PT/point_tracker.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-01-12 19:53:59 +0100
committerStanislaw Halik <sthalik@misaki.pl>2014-01-12 19:53:59 +0100
commit302dfd055bd368752216701a0d0e963d5bf6d3e9 (patch)
tree15f0400936871e59cc5a159221e6a7118c102600 /FTNoIR_Tracker_PT/point_tracker.h
parent0d2a44867c9f5c31789152e8f5735dc85987554e (diff)
Revert "remove hack of passing fov/w/h as member vars"
This reverts commit 6e1610667fb33517299997e628652fd91380e762.
Diffstat (limited to 'FTNoIR_Tracker_PT/point_tracker.h')
-rw-r--r--FTNoIR_Tracker_PT/point_tracker.h8
1 files changed, 6 insertions, 2 deletions
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<cv::Vec2f>& points, float fov, int w, int h);
+ bool find_correspondences(const std::vector<cv::Vec2f>& points);
cv::Vec2f p[PointModel::N_POINTS]; // the points in model order
cv::Vec2f p_exp[PointModel::N_POINTS]; // the expected point positions