summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-20 22:43:50 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-20 23:24:13 +0200
commit8faba81716c5d4283a31262dea795888cdb372b0 (patch)
tree6814b0261264d6f1b3996f96e45e12cbc548b1e4 /tracker-pt/camera.cpp
parentc28efa181dc302489ff5bd1bb2f7d2d5d88bfd92 (diff)
tracker/pt: use doubles
We don't have pt_types namespace on this branch so hardcode using double instead.
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r--tracker-pt/camera.cpp10
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";
}
}