diff options
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r-- | tracker-pt/camera.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp index ee021d4c..1aceb783 100644 --- a/tracker-pt/camera.cpp +++ b/tracker-pt/camera.cpp @@ -53,16 +53,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 - const float dt_smoothing_const = 0.95; + const double dt_smoothing_const = 0.95; dt_valid += dt; if (new_frame) { - dt_mean = dt_smoothing_const * dt_mean + (1.0 - dt_smoothing_const) * dt_valid; - cam_info.fps = dt_mean > 1e-3 ? 1.0 / dt_mean : 0; + dt_mean = dt_smoothing_const * dt_mean + (1 - dt_smoothing_const) * dt_valid; + cam_info.fps = int(std::round(dt_mean > 1e-3 ? 1 / dt_mean : 0)); dt_valid = 0; } else @@ -102,7 +102,7 @@ void CVCamera::stop() // give opencv time to exit camera threads, etc. if (opened) portable::sleep(500); - qDebug() << "pt camera: assuming stopped"; + qDebug() << "pt camera: stopped"; } } |