Ask Your Question

Revision history [back]

It is a simple programming issue. Here you go:

int frame_num = 0;
const int num_to_skip = 2;  // Number of frames to skip
while(1)
{
    bool bSuccess = capture.read(fullimage); // read a new frame from video
    if (!bSuccess)                          //if not success, break loop
    {
        cout << "End of video" << endl;
        destroyWindow("Original Video");
        destroyWindow("dctBlockImage");
        break;
    }

    imshow("Original Video", fullimage);    //show the frame in "Original Video" window
    if ( ++frame_num < num_to_skip )
        continue;

    /* Rest of the loop */