Ask Your Question

Revision history [back]

VideoCapture class cannot initialize

Hello Masters, I'm very newbie in OpenCV. I'm trying to capture image from webcam. But, if I "declare" an VideoCapture object, my program crashes instantly. This is my code:

#include "opencv2/opencv.hpp"
#include <stdio.h>
using namespace cv;
int main()
{
    printf("Trying...");
    VideoCapture cap;
    printf("done");
}

My system is with Windows XP SP2. Not a good machine too. Not found anything like this yet...