Read Webcam

Learn to read the webcam's feed and display it.

Capture the webcam’s feed

To capture a webcam’s feed, we use the cv2.VideoCapture(0) method. Here, 0 represents the default camera being used to capture the video.

vid = cv2.VideoCapture(0)

Note: We need to import the cv2 library before using the function.

Set the display

...