From b8f8814cf98486bb17c4b15401a02bc47383e2b4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 9 Jun 2016 11:54:17 +0200 Subject: tracker/pt: add rounding to camera Hz --- tracker-pt/camera.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp index 1c393c12..e5901da1 100644 --- a/tracker-pt/camera.cpp +++ b/tracker-pt/camera.cpp @@ -67,12 +67,12 @@ bool Camera::get_frame(float dt, cv::Mat* frame) { bool new_frame = _get_frame(frame); // measure fps of valid frames - constexpr float dt_smoothing_const = 0.95; + constexpr float dt_smoothing_const = 0.95f; dt_valid += dt; if (new_frame) { dt_mean = dt_smoothing_const * dt_mean + (1 - dt_smoothing_const) * dt_valid; - cam_info.fps = dt_mean > 1e-3f ? 1 / dt_mean : 0; + cam_info.fps = int(std::round(dt_mean > 1e-3f ? 1 / dt_mean : 0)); dt_valid = 0; } else -- cgit v1.2.3