summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-10-12 19:07:54 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-10-12 17:08:59 +0000
commit496fda510969441a873160b20e297beac046be20 (patch)
tree4b2e95ecba69f3da7ecf85eeffec510428aa36bc /tracker-pt
parent9ef1c02adea70a46c91503e2c0c960262280ba24 (diff)
tracker/pt: add more robust camera retry
Some cameras can't produce frames right after the capture is opened. Adjust the delay to something more sane. It has a strange effect of not crashing PS3 Eye as often, but that needs more testing (and crashes).
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/module/camera.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp
index 14b565b6..e2edfcb6 100644
--- a/tracker-pt/module/camera.cpp
+++ b/tracker-pt/module/camera.cpp
@@ -151,11 +151,11 @@ bool Camera::_get_frame(cv::Mat& frame)
{
if (cap && cap->isOpened())
{
- for (int i = 0; i < 5; i++)
+ for (unsigned i = 0; i < 10; i++)
{
if (cap->read(frame))
return true;
- portable::sleep(1);
+ portable::sleep(50);
}
}
return false;