1 #include <opencv2/core/core.hpp>
2 #include <opencv2/videoio/videoio.hpp>
3 #include <opencv2/highgui/highgui.hpp>
10 static void help(char** argv)
12 cout << "\nThis sample shows you how to read a sequence of images using the VideoCapture interface.\n"
13 << "Usage: " << argv[0] << " <image_mask> (example mask: example_%02d.jpg)\n"
14 << "Image mask defines the name variation for the input images that have to be read as a sequence. \n"
15 << "Using the mask example_%02d.jpg will read in images labeled as 'example_00.jpg', 'example_01.jpg', etc."
19 int main(int argc, char** argv)
27 string first_file = argv[1];
28 VideoCapture sequence(first_file);
30 if (!sequence.isOpened())
32 cerr << "Failed to open the image sequence!\n" << endl;
37 namedWindow("Image sequence | press ESC to close", 1);
41 // Read in image from sequence
44 // If no image was retrieved -> end of sequence
47 cout << "End of Sequence" << endl;
51 imshow("Image sequence | press ESC to close", image);
53 if(waitKey(500) == 27)