Ask Your Question

jerdman's profile - activity

2012-11-06 12:35:55 -0600 received badge  Editor (source)
2012-11-06 12:34:25 -0600 asked a question VideoCapture with VC500

I am trying to use a Diamond VC500 usb device to capture video using OpenCV 2.4.2 in Windows 7 Ultimate, programming in c++ in Visual Studio 2010.

So far, I have the following code:

    CvCapture* cap = cvCaptureFromCAM(camIndex);
if(!cap){
    std::cout << "Camera not open!\n";
    return -1;
}

cv::namedWindow("camera", 1);
cv::Mat frame;
while(true){
    frame = cvQueryFrame(cap);
    cv::imshow("camera", frame);
    if(cv::waitKey(30) >= 0)
        break;
}

It does just what it is supposed to, continuously capture video, but I can't choose the camera device that I want.

-1, 0, and CV_CAP_ANY all go straight to the built in Apple iSight camera (dual booting on an iMac). Values 1..10 give me a light gray screen. I've tested the VC500 and I've captured video with the software it comes with, I just can't get it to work with opencv.