From d576eca6a6e894606239f36b54dcb3fe5f0744cf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 21 Jun 2016 11:09:00 +0200 Subject: tracker/pt: move pi constant to headers --- tracker-pt/ftnoir_tracker_pt.cpp | 1 - tracker-pt/ftnoir_tracker_pt.h | 2 ++ tracker-pt/point_extractor.h | 4 +++- tracker-pt/point_tracker.cpp | 2 -- tracker-pt/point_tracker.h | 2 ++ 5 files changed, 7 insertions(+), 4 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 6ff19479..2e6fd9b1 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -63,7 +63,6 @@ bool Tracker_PT::get_focal_length(float& ret) const bool res = camera.get_info(info); if (res) { - static constexpr double pi = 3.14159265359; const int w = info.res_x, h = info.res_y; const double diag = sqrt(1. + h/(double)w * h/(double)w); const double diag_fov = static_cast(s.fov) * pi / 180.; diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index b6815bd7..d3b96f1d 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -31,6 +31,8 @@ class TrackerDialog_PT; // Constantly processes the tracking chain in a separate thread class Tracker_PT : public QThread, public ITracker { + static constexpr double pi = 3.14159265359; + Q_OBJECT friend class camera_dialog; friend class TrackerDialog_PT; diff --git a/tracker-pt/point_extractor.h b/tracker-pt/point_extractor.h index 3e4661f9..b3fac38a 100644 --- a/tracker-pt/point_extractor.h +++ b/tracker-pt/point_extractor.h @@ -28,7 +28,9 @@ public: settings_pt s; private: - enum { hist_c = 2 }; + static constexpr double pi = 3.14159265359; + static constexpr int hist_c = 1; + std::vector points; QMutex mtx; cv::Mat frame_gray; diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index d3a3d400..1fb4128e 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -13,8 +13,6 @@ #include -const float PI = 3.14159265358979323846f; - static void get_row(const cv::Matx33f& m, int i, cv::Vec3f& v) { v[0] = m(i,0); diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index f964a107..e3f6cdb9 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -118,6 +118,8 @@ public: Affine pose() { QMutexLocker l(&mtx); return X_CM; } cv::Vec2f project(const cv::Vec3f& v_M, float f); private: + static constexpr float PI = 3.14159265358979323846f; + // the points in model order struct PointOrder { -- cgit v1.2.3