|
@@ -110,7 +110,12 @@ class OpticalSensor():
|
|
|
self._t.start()
|
|
|
|
|
|
def _getFrames(self):
|
|
|
- self.cap = cv2.VideoCapture(self.conf["opt_sensor"]["capture_device"])
|
|
|
+ try:
|
|
|
+ dev = int(self.conf["opt_sensor"]["capture_device"])
|
|
|
+ except ValueError:
|
|
|
+ dev = self.conf["opt_sensor"]["capture_device"]
|
|
|
+ self.cap = cv2.VideoCapture(dev)
|
|
|
+
|
|
|
while self.running:
|
|
|
self.success, image = self.cap.read()
|
|
|
if self.success:
|