Gave cameras more time to warm up.

This commit is contained in:
Emiliana 2020-08-08 17:13:48 +02:00
parent e915f87887
commit 8cb8c97310

View file

@ -124,16 +124,20 @@ def try_int(s):
return None return None
def test_reader(reader): def test_reader(reader):
got_any = False
try: try:
for i in range(30): for i in range(30):
if not reader.is_ready(): if not reader.is_ready():
time.sleep(0.02) time.sleep(0.02)
ret, frame = reader.read() ret, frame = reader.read()
if not ret: if not ret:
print("Not ret") time.sleep(0.02)
return False print("No frame")
else:
print("Got frame")
got_any = True
if reader.is_open(): if reader.is_open():
return True return got_any
print("Fail") print("Fail")
return False return False
except: except: