Gave cameras more time to warm up.
This commit is contained in:
parent
e915f87887
commit
8cb8c97310
1 changed files with 7 additions and 3 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue