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

Camera Access Check on AI_Attendance_Program #254

Open
Eshanshahriar1234 opened this issue Sep 18, 2024 · 3 comments
Open

Camera Access Check on AI_Attendance_Program #254

Eshanshahriar1234 opened this issue Sep 18, 2024 · 3 comments

Comments

@Eshanshahriar1234
Copy link

The code does not check if the camera is accessed. Possible fix could be a method to check if the webcam was properly accessed or not and return an error message if it is not accessed.

@JC230903
Copy link

import cv2

cap = cv2.VideoCapture(0)

if not cap.isOpened():
print("Error: Could not access the webcam")
else:
while True:
ret, frame = cap.read()
if not ret:
print("Failed to grab frame")
break

    cv2.imshow('Webcam Feed', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

@Fuad-san
Copy link

Fuad-san commented Oct 6, 2024

Hi is this issue still open

@janetjoseph02
Copy link

I would be glad to contribute to this, so it would be great if you could assign me this task.
Thanks,
Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants