相机补丁

This commit is contained in:
Your Name 2024-09-23 16:09:59 +08:00
parent d9a6844d4d
commit a9776477b9
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ class Camera(object):
record_signal = False
# 错误计数
error_counting = 0
max_error = 5
max_error = 50
def __init__(self):
"""Start the background camera thread if it isn't running yet."""

View File

@ -8,7 +8,7 @@ from AcrossPlatform.get_platform import *
def camera_is_available(source=0):
# 根据平台导入对应的包
if SYS_PLATFORM == WINDOWS:
cap = cv2.VideoCapture(source)
cap = cv2.VideoCapture(source, cv2.CAP_DSHOW)
elif SYS_PLATFORM == LINUX:
cap = cv2.VideoCapture(source, cv2.CAP_V4L2)
else: