Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the 'waitKey(some_millis)' has to go after the imshow(), else your window won't get updated:

VideoCapture cap(0);
for(int i=0; (i<=2 && cap.isOpened()); i++)
{
    cap >> frame;
    imshow("Video", frame);
    if ( char(waitKey(1)) == 'q' ) 
        break;
}

the 'waitKey(some_millis)' has to go after the imshow(), else your window won't get updated:

VideoCapture cap(0);
for(int i=0; (i<=2 && cap.isOpened()); i++)
{
    cap >> frame;
    imshow("Video", frame);
    frame.copyTo(picture);
    if ( char(waitKey(1)) == 'q' ) 
        break;
}