python cv2 camera by name code example
Example: how to show webcam in opencv
import cv2
cap = cv2.VideoCapture(0)
while True:
success, img = cap.read()
cv2.imshow("Webcam", img)
if cv2.waitKey(1) == ord('q'):
break
import cv2
cap = cv2.VideoCapture(0)
while True:
success, img = cap.read()
cv2.imshow("Webcam", img)
if cv2.waitKey(1) == ord('q'):
break