// ================= // || Worksheet 9 // || In this exercise, we are going be creating slideshows // ================= #include "program.h" using namespace std; using namespace cv; int worksheetnine(Mat& src) { Size imsize(640,480); // a window to show our outputs cv::namedWindow( "current frame", WINDOW_AUTOSIZE ); int MAX_NUMBER_OF_FRAMES = 100; // repeat this for each of the frames. for (int i =0; i < MAX_NUMBER_OF_FRAMES; i++) { Mat frame = Mat::zeros(imsize, CV_32F); // draw a point moving slowly. frame.at(2*i,3*i) = 1.0f; // display the current frame. cv::imshow( "current frame", frame); // wait for a key press to continue; //cv::waitKey(); //wait for 'esc' key press for 300ms. If 'esc' key is pressed, break loop if (waitKey(100) == 27) { cout << "esc key is pressed by user" << endl; break; } } return 0; }