Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

by default, imshow() fits the window to the image size (WINDOW_AUTOSIZE), you probably want the opposite:

namedWindow("Webcam", WINDOW_NORMAL);
while(1)
{
    Mat frame;
    cap >> frame;
    imshow("Webcam", frame);
    if (waitKey(30) >= 0) break;
}