2 个 USB 摄像头不适用于 opencv [英] 2 usb cameras not working with opencv
问题描述
我正在做一个计算机视觉项目,我需要使用两个使用 opencv 库的摄像头.我尝试了此代码,但是使用来自 USB 端口的两个网络摄像头,如果我使用一个 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
");
我正在 acer aspire 5742g 上使用 Windows 7.是我电脑总线的问题吗?相机是 2 台飞利浦 SPZ2000.我还尝试处理其中一个人和我电脑上的相机拍摄的照片,当我使用 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.
有关此问题的更多信息:
这篇关于2 个 USB 摄像头不适用于 opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!