Capturing multiple webcams (uvcvideo) with OpenCV on Linux

前端 未结 7 1210
时光取名叫无心
时光取名叫无心 2020-12-03 01:56

I am trying to simultaneously stream the images from 3 Logitech Webcam Pro 900 devices using OpenCV 2.1 on Ubuntu 11.10. The uvcvideo driver gets loaded for these.

C

7条回答
  •  无人及你
    2020-12-03 02:39

    I had this exact problem, using three logitech quickcam pro 9000 cameras (using ubuntu). I could read from two, but not three. In my case, I wasn't using opencv, but was accessing the cameras through V4L2 directly, using memory-mapped IO. Simply put, there was not enough USB bandwidth to allocate three buffers.

    I was reading in the uncompressed frames, however. As soon as I switched the format to MJPEG, the data was small enough, and I could read from the three cameras. I used libjpeg to decode the MJPEG stream.

    I haven't looked into how to change the image format using OpenCV, but I do know that it needs to be MJPEG to fit all that data.

    Before I switched to MJPEG, I spent a lot of time trying to access each camera one at a time, streaming a single frame before switching to the next. Not recommended!

提交回复
热议问题