Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update python webcam.py #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions python webcam.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
# id of the video capturing device to open. To open default camera using default backend just pass 0.
capture = cv2.VideoCapture(0)

# Check if the camera is opened successfully
if not capture.isOpened():
print("Error: Unable to access the camera.")
exit()

while True:
_, frame = capture.read()
# We give the Window a name of "Capture from Webcam", and we also give it the frame which is an numpy object.
Expand Down