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
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.