相机补丁
This commit is contained in:
parent
d9a6844d4d
commit
a9776477b9
|
@ -77,7 +77,7 @@ class Camera(object):
|
||||||
record_signal = False
|
record_signal = False
|
||||||
# 错误计数
|
# 错误计数
|
||||||
error_counting = 0
|
error_counting = 0
|
||||||
max_error = 5
|
max_error = 50
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Start the background camera thread if it isn't running yet."""
|
"""Start the background camera thread if it isn't running yet."""
|
||||||
|
|
|
@ -8,7 +8,7 @@ from AcrossPlatform.get_platform import *
|
||||||
def camera_is_available(source=0):
|
def camera_is_available(source=0):
|
||||||
# 根据平台导入对应的包
|
# 根据平台导入对应的包
|
||||||
if SYS_PLATFORM == WINDOWS:
|
if SYS_PLATFORM == WINDOWS:
|
||||||
cap = cv2.VideoCapture(source)
|
cap = cv2.VideoCapture(source, cv2.CAP_DSHOW)
|
||||||
elif SYS_PLATFORM == LINUX:
|
elif SYS_PLATFORM == LINUX:
|
||||||
cap = cv2.VideoCapture(source, cv2.CAP_V4L2)
|
cap = cv2.VideoCapture(source, cv2.CAP_V4L2)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue