summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/camera.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-11 20:38:12 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-11 20:38:12 +0200
commit8f0578cca48ab6757b0ddb6a876cbc90fa1d82b7 (patch)
tree5fc1f00386db279bea756184194172f2ea5585eb /ftnoir_tracker_pt/camera.cpp
parent3f6e60abec9285e803b0e2b380e3fea490b6e392 (diff)
Avoid floating point division by zero
Maybe-fixes-issue: #79
Diffstat (limited to 'ftnoir_tracker_pt/camera.cpp')
-rw-r--r--ftnoir_tracker_pt/camera.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ftnoir_tracker_pt/camera.cpp b/ftnoir_tracker_pt/camera.cpp
index 861c83cc..7c2c09ce 100644
--- a/ftnoir_tracker_pt/camera.cpp
+++ b/ftnoir_tracker_pt/camera.cpp
@@ -137,7 +137,7 @@ bool Camera::get_frame(float dt, cv::Mat* frame)
if (new_frame)
{
dt_mean = dt_smoothing_const * dt_mean + (1.0 - dt_smoothing_const) * dt_valid;
- cam_info.fps = 1.0 / dt_mean;
+ cam_info.fps = dt_mean > 1e-3 ? 1.0 / dt_mean : 0;
dt_valid = 0;
}
return new_frame;