We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e43051f commit 6c92d89Copy full SHA for 6c92d89
face-try.py
@@ -27,6 +27,11 @@
27
# Start video capture
28
cap = cv2.VideoCapture(0)
29
30
+#check for external if built-in camera is not working
31
+if not cap.isOpened():
32
+ print("[WARNING] Camera index 0 not available, trying index 1.....")
33
+ cap.cv2.VideoCapture(1)
34
+
35
if not cap.isOpened():
36
print("[ERROR] Cannot access webcam.")
37
sys.exit(1)
0 commit comments