I have a multiple camera setup and an OpenCV application that has been working using two cameras. One camera is a Logitech C310, and the other has been my built-in camera on my MacBook Pro. On initialization I call cvCaptureFromCAM(), once for each camera. However, hooking up a second Logitech C310 (total of 3 cameras) causes the call to cvCaptureFromCAM() to hang for my MacBook pro camera.
Both Logitech cameras work together just fine. Once I call cvQueryFrame() for my MacBook camera it hangs, but eventually after maybe 2-3 minutes it returns what appears to be a valid pointer (i.e. not NULL), but that camera is not initialized. I receive no frames from that camera, and the light that is typically green when the camera is in use is not lit.
Here is a snippet of my code:
for( size_t i = 0; i < NUM_CAMERAS; i++ ) // Works fine when NUM_CAMERAS is 2, but hangs when it is 3
{
capture[i] = cvCaptureFromCAM( i );
if( capture[i] != NULL )
{
// Start a thread for each camera
}
}
// Threads manage calling cvQueryFrame() for each camera.
I am certain this is not an issue with multiple threads, because cvQueryFrame() always hangs, even if I do not start any new threads.
Thanks for any help - I'm having trouble finding anyone else with a similar issue.
OpenCV 2.4.5 OSX 10.8.4 gcc 4.2 Qt 5.0.2 Boost version 105300 2.4GHz Intel Core i7, retina Mac, 8BG RAM 2 x Logitech C310, 1 x MacBook Pro Camera 1 x Frustrated Dude