Detect the number of webcams/cameras on PC with OpenCv

前端 未结 1 1548
心在旅途
心在旅途 2021-01-18 15:53

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

相关标签:
1条回答
  • 2021-01-18 16:17

    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.

    0 讨论(0)
提交回复
热议问题