5

I'm making an application running multiple webcams/cameras. I cannot manage to detect the number of webcams I have with OpenCV to arrage a big display window with multiple sub webcams in it.

Someone can help me this?

I've searched openCV willowgarage but failed

thanks

1 Answer 1

9

I don't think OpenCV provides any function to tell how many cameras are detected. An easy and cross-platform way is to call VideoCapture::open() in a loop with say 0 to 10, and in each iteration check if VideoCapture::isOpened() returns true. This way you know the index of the cameras and how many of them you've got.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.