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;
}
2 | No.2 Revision |
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;
}