summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/camera.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp
index 89854cc7..709ec612 100644
--- a/tracker-pt/camera.cpp
+++ b/tracker-pt/camera.cpp
@@ -125,13 +125,12 @@ DEFUN_WARN_UNUSED bool Camera::_get_frame(cv::Mat& frame)
{
if (cap && cap->isOpened())
{
- for (int i = 0; i < 5 && !cap->read(frame); i++)
+ for (int i = 0; i < 5; i++)
+ {
+ if (cap->read(frame))
+ return true;
portable::sleep(100);
-
- if (frame.empty())
- return false;
-
- return true;
+ }
}
return false;
}