diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:54:17 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-08-01 08:14:41 +0200 |
commit | b8f8814cf98486bb17c4b15401a02bc47383e2b4 (patch) | |
tree | d12dec2bdf4ca5b73d02f5fad3320f968e2e35e3 /tracker-pt/camera.cpp | |
parent | 4e1cdb6ada712225fcb0ceffedaf91656265aeb1 (diff) |
tracker/pt: add rounding to camera Hz
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r-- | tracker-pt/camera.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 |