Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi! You can use VideoCapture class for that. Here the sample:

VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
    return -1;
namedWindow("video",1);
for(;;)
{
    Mat frame;
    cap >> frame; // get a new frame from camera
    imshow("video", frame);
    if(waitKey(30) >= 0) break;
}