Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

2 usb cameras not working with opencv

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

like image 301
mafalda Avatar asked Jan 17 '23 06:01

mafalda


1 Answers

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:

  • Implications of using many USB web cameras
  • How many USB cameras can be accessed by one PC
  • Not able to capture video using 2 webcamera simulteneously
  • Two webcams on one usb hub - bandwidth issues
like image 78
Roman R. Avatar answered Jan 30 '23 19:01

Roman R.