OpenCV with 2 VC ++ cameras

I import the source code for stereo imaging. The following author code works. Two camera sources are required. I currently have two different cameras and I am receiving images. Both work. He crashes on capture 2. Interestingly, if I change the orders of webcams (turning them off and inverting orders), the first camera will be the second. We do not work? I tested also with Windows XP sp3 and Windows 7 X64. Same problem.

//---------Starting WebCam----------
    capture1= cvCaptureFromCAM(1);
    assert(capture1!=NULL); cvWaitKey(100);
    capture2= cvCaptureFromCAM(2);
    assert(capture2!=NULL);

Also, if I use -1 for parameters, just give me the first one (all the time).

Or any way to capture two cameras using the cvCaptureFrom function

+3
source share
3 answers

Firstly, cameras are usually numbered from 0 - is this just a problem?

-, directshow - USB, , . , , .

, , , .

, . , + fdirectshow Windows

+2

- USB- 2.0. usb 2.0 40-60% usb. USB- 2.0 pci2usb.

+2

2 PS3 Eyes, 10 , SDK codelaboratories.com.com, 2 C, #, Java AS3, . .. FIXED 75 fps @640 * 480. 5.1.1.0177 DirectShow, .

COmment : DirectShow , , USB . , /.

, ( DirectShow):

  • Microsoft Lifecam HD Cinema (use the generic UVC driver, if you can, less limited fps)
  • Logitech Webcam Pro 9000 (not to be confused with QuickCam Pro 9000, which does NOT work)
  • Creative VF0220
  • Creative VF0330
  • Canyon WCAMN-1N

If you are serious about your job, get a couple of machine vision cameras to get FULL. The cheapest on the market, with German engineering quality, CCD, CMOS, mono, color, GigE (ethernet), USB, FireWire, an excellent selection of dedicated drivers:

http://www.theimagingsource.com

+1
source

All Articles