1

下面的 openCV 代码从两个摄像头同时获取图像。它在 Windows 中运行良好,摄像头都连接到一个 USB 2.0 集线器。当我在 linux 中尝试相同的代码时,它一次只有一个摄像头的足够带宽。我也试过用 guvcview 一次查看两个流,同样的问题。我需要的是某种强制网络摄像头协同工作的方法,可能是通过设置驱动程序请求的带宽量。

capture = cv.CaptureFromCAM(0)
capture2 = cv.CaptureFromCAM(1)

while True: 
    frame = cv.QueryFrame(capture)
    frame2 = cv.QueryFrame(capture2)
    cv.ShowImage("w1", frame)
    cv.ShowImage("w2", frame2)    
    if cv.WaitKey(10) != -1:
        break
4

3 回答 3

2

我也遇到了网络摄像头(LifeCam Cinema)的 USB 带宽问题,并通过使用 uvcvideo 驱动程序的 FIX_BANDWIDTH怪癖解决了这个问题。有关使用怪癖的详细信息,请参阅此答案

没有怪癖,对于我尝试过的一些 USB 主机控制器,两个 LifeCam 工作(每个控制器);对于其他人,只有一个。这是我的一台机器视觉机器中的控制器:

uli@KL04:~$ lspci | grep USB
00:1a.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #2 (rev 06)
00:1d.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #1 (rev 06)
03:00.0 USB controller: VIA Technologies, Inc. Device 3483 (rev 01)
0a:00.0 USB controller: ASMedia Technology Inc. Device 1142
0b:00.0 USB controller: ASMedia Technology Inc. Device 1142

(Intel 和 ASMedia 控制器在主板上,VIA 在 PCIe 卡上。)毫无疑问,每个 ASMedia 控制器只支持一个 LifeCam。

于 2016-01-14T22:53:57.237 回答
1

The issue might be here that the cameras run some sort of video compression in their windows drivers, while they might run uncompressed in Linux - at a higher data rate.

If that is the case, then you may need to put them on different USB busses to make them work both at a time in Linux. This could require you to add a PCI or PCIe USB card to your system - many motherboards do only implement one USB2.0 high speed bus.

于 2011-07-14T04:24:19.217 回答
1

您可以将网络摄像头配置为使用较低的分辨率或帧速率,从而减少带宽吗?

于 2011-07-14T05:37:35.390 回答