Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV on mac not opening USB web cam

I have been unsuccessful using OpenCV's VideoCapture.open(int) to get video capture from a USB web cam in my MacBook Pro running OS 10 Lion. Using open(0) successfully gets capture from the iSight camera. But no luck trying to find the WebCam. (WebCam is a PS2 EyeToy)

The WebCam is installed and works well with Skype, and the macam driver application.

Here is a portion of the code that I'm using:

VideoCapture cap; 
for (int i = 1; i < 1500; i++) {
    if (cap.open(i))
    {
        cout << "Found camera %d\n" << i;
        break;
    }
}
if(!cap.isOpened())  // check if we succeeded
    return -1;

If I initialize i with 0 it immediately finds the iSight camera. If I initialize i with 1, then it finds iSight again when i = 500

Any help is appreciated, Thanks.