cannot fix video source not found
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 MiB After Width: | Height: | Size: 2.1 MiB |
@@ -59,9 +59,6 @@ class Sensor:
|
|||||||
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
|
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920)
|
||||||
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
|
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080)
|
||||||
|
|
||||||
if not self.cap.isOpened():
|
|
||||||
raise RuntimeError("Could not open video source")
|
|
||||||
|
|
||||||
# Wait for first valid frame
|
# Wait for first valid frame
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("Sensor connecting to video source...")
|
print("Sensor connecting to video source...")
|
||||||
@@ -70,7 +67,6 @@ class Sensor:
|
|||||||
ret, frame = self.cap.read()
|
ret, frame = self.cap.read()
|
||||||
if not ret:
|
if not ret:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
raise RuntimeError("Could not open video source")
|
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print("Video source connected.")
|
print("Video source connected.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user