带有2个摄像机的OpenCV VC ++ [英] OpenCV with 2 cameras VC++
问题描述
我正在导入立体视觉的源代码.作者的下一个代码起作用.它需要两个相机源.我目前有两个不同的相机,我接收图像.两者都可以.它在capture2时崩溃.有趣的是,如果我更改网络摄像头的顺序(拔下它们并颠倒顺序),则第一个摄像头将是第二个.我们行不通吗?我还使用Windows XP sp3和Windows 7 X64进行了测试.同样的问题.
I am importing a source code for stereo visions. The next code of the author works. It takes two cameras sources. I have two different cameras currently and i receive images. Both works. It crashes at capture2. interesting part is that if i change the orders of the webcams(Unplugging them and invert the orders) the first camera it will be the second one. We it doesn't work? I tested also with Windows XP sp3 and Windows 7 X64. The same problem.
//---------Starting WebCam----------
capture1= cvCaptureFromCAM(1);
assert(capture1!=NULL); cvWaitKey(100);
capture2= cvCaptureFromCAM(2);
assert(capture2!=NULL);
如果我使用-1作为参数,只要给我第一个(一直).
Also If i use -1 for paramters the just give me the first one(all the time).
或者使用cvCaptureFrom函数捕获任何两个凸轮的方法
Or any method to capture two camers using function cvCaptureFrom
推荐答案
某些主板不能与某些USB 2.0相机配合使用.一台USB 2.0相机占用了40-60%的USB控制器.解决方案是从pci2usb控制器连接第二个USB 2.0摄像机
some mother board can not work with some usb 2.0 cameras. one usb 2.0 camera take 40-60% of usb controller. solution is connect second usb 2.0 camera from pci2usb controller
这篇关于带有2个摄像机的OpenCV VC ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!