2 usb cameras not working with opencv

北慕城南 提交于 2019-12-17 03:21:18

问题


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:


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


来源:https://stackoverflow.com/questions/11222813/2-usb-cameras-not-working-with-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!