mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
added start cameras method
This commit is contained in:
@@ -17,3 +17,11 @@ class CamerasHandler:
|
||||
cap.release()
|
||||
index += 1
|
||||
return [usb_devices[i] for i in arr]
|
||||
|
||||
@staticmethod
|
||||
def start_cameras(usb_devices):
|
||||
cameras = []
|
||||
for device in usb_devices:
|
||||
camera = cscore.UsbCamera(name='', dev=device.dev)
|
||||
cameras.append(camera)
|
||||
return cameras
|
||||
|
||||
@@ -31,7 +31,7 @@ class SettingsManager(metaclass=Singleton):
|
||||
|
||||
def _init_cameras(self):
|
||||
cameras = CamerasHandler.get_cameras()
|
||||
|
||||
|
||||
for cam in cameras:
|
||||
if os.path.exists(os.path.join(self.cams_path, cam.name)):
|
||||
self.cams[cam.name] = {}
|
||||
|
||||
Reference in New Issue
Block a user