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
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 ifVideoCapture::isOpened()returnstrue. This way you know the index of the cameras and how many of them you’ve got.