2 usb cameras not working with opencv

2019-01-04 14:25发布

I'm working on a project of computer vision and I need to use two cameras using opencv library. I tried this code but with two webcams from USB port it doesn't work while it works if I use one usb camera and the camera of my pc.

CvCapture* capture[2];                      

capture[0] = cvCreateCameraCapture(0);
capture[1] = cvCreateCameraCapture(1);

if(!capture[0] && !capture[1])
    printf("Webcam error\n");

I'm working on windows 7 on an acer aspire 5742g. Is it a problem of the bus of my computer? The cameras are 2 Philips SPZ2000. I tried also to work on the pictures taken by the one of them and from the camera on my pc and when I use the code for calibration and rectification found on the book "Learning opencv" of Bradsky I get a bad result. Can somebody help me? Thank you in advance,

Sara

1条回答
2楼-- · 2019-01-04 14:29

The typical reason for 2+ USB cameras to not work together (still they might be working fine separately) is that USB bandwidth is insufficient for them both to run simultaneously. There is a bandwidth limit, which is rather low: The maximum throughput of an isochronous pipe (which is usually used for video) is 24MB/s.

More on this issue:

查看更多
登录 后发表回答