2 USB相机无法与OpenCV一起使用 [英] 2 usb cameras not working with opencv
问题描述
我正在从事计算机视觉项目,我需要使用两个使用opencv库的相机.我尝试了此代码,但是如果我使用一个USB摄像头和我的PC摄像头,则有两个USB端口的网络摄像头无法正常工作.
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");
我正在使用acer aspire 5742g在Windows 7上工作.这是我的计算机的总线问题吗?摄像机是2台Philips SPZ2000. 我还尝试处理其中一位所拍摄的照片以及从我的PC相机上拍摄的照片,当我使用Bradsky的"Learning opencv"一书中的校准和校正代码时,结果很差.有人可以帮我吗? 预先谢谢你,
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,
萨拉
推荐答案
2个以上USB摄像头无法一起工作的典型原因(仍然可能分别正常工作)是USB带宽不足,无法让它们同时运行.有一个很低的带宽限制:同步管道(通常用于视频)的最大吞吐量为24MB/s .
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.
有关此问题的更多信息:
- 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
这篇关于2 USB相机无法与OpenCV一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!