From 2d7e8f1467a37b66a87c949ad266dc9b41c9a1b1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Aug 2016 12:34:26 +0200 Subject: tracker/pt: all callers are double, so float -> double --- tracker-pt/camera.cpp | 6 +++--- tracker-pt/camera.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp index c15bb2be..94a9d314 100644 --- a/tracker-pt/camera.cpp +++ b/tracker-pt/camera.cpp @@ -63,16 +63,16 @@ bool Camera::get_info(CamInfo& ret) return true; } -bool Camera::get_frame(float dt, cv::Mat* frame) +bool Camera::get_frame(double dt, cv::Mat* frame) { bool new_frame = _get_frame(frame); // measure fps of valid frames - constexpr float dt_smoothing_const = 0.95f; + static constexpr double dt_smoothing_const = 0.95; dt_valid += dt; if (new_frame) { dt_mean = dt_smoothing_const * dt_mean + (1 - dt_smoothing_const) * dt_valid; - cam_info.fps = int(std::round(dt_mean > 1e-3f ? 1 / dt_mean : 0)); + cam_info.fps = int(std::round(dt_mean > 1e-3 ? 1 / dt_mean : 0)); dt_valid = 0; } else diff --git a/tracker-pt/camera.h b/tracker-pt/camera.h index e9993855..323ea647 100644 --- a/tracker-pt/camera.h +++ b/tracker-pt/camera.h @@ -41,7 +41,7 @@ public: void set_res(int x_res, int y_res); // gets a frame from the camera, dt: time since last call in seconds - bool get_frame(float dt, cv::Mat* frame); + bool get_frame(double dt, cv::Mat* frame); // WARNING: returned references are valid as long as object bool get_info(CamInfo &ret); @@ -57,8 +57,8 @@ protected: virtual void _set_fps() = 0; virtual void _set_res() = 0; private: - float dt_valid; - float dt_mean; + double dt_valid; + double dt_mean; protected: CamInfo cam_info; CamInfo cam_desired; -- cgit v1.2.3