OpenCV on mac not opening USB web cam

asked 2013-01-06 17:44:16 -0500

vixo7 gravatar image

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.

edit retag flag offensive close merge delete

Comments

have you found a solution for this problem? i am also working on a project with eye toy camera 2

manntobias gravatar imagemanntobias ( 2014-12-05 11:23:35 -0500 )edit