Skip to content

Conversation

@AnimeshRajwar
Copy link
Contributor

add additonal check for external camera if builtin one is not working.

Copy link
Owner

@Gagandeep-2003 Gagandeep-2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I noticed a couple of issues that should be fixed before merging:

Bug in camera fallback

cap.cv2.VideoCapture(1) # ❌ incorrect

This should be reassigned properly:

cap = cv2.VideoCapture(1) # ✅

Resource handling
It’s good practice to cap.release() before re-opening with a new index.

Verification
Sometimes cap.isOpened() is True but frames still can’t be read. You can make it more robust by checking a test frame:

ok, _ = cap.read()
if not ok:
print("[ERROR] No frames captured from webcam.")
cap.release()
sys.exit(1)

@AnimeshRajwar
Copy link
Contributor Author

got it,i will fix it.

@AnimeshRajwar
Copy link
Contributor Author

@Gagandeep-2003 i have already made the requested changes in commit 43a8812

feat: made requested changes

@AnimeshRajwar
Copy link
Contributor Author

@Gagandeep-2003 kindly review commit 99b1a9e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gssoc25 level 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants