I need to do image sequencing for each movement.I need to use a loop.For e.g,to recognise one movement I need to have 3 static movement in a row.But only one image is being recognised. Here is my c++ code.How to do it?
#include <opencv2 core="" core.hpp="">
include <opencv2 highgui="" highgui.hpp="">
include <vector>
include <iostream>
using namespace cv; using namespace std;
vector<mat> imageQueue;
int main(int argc, char** argv) { string arg = ("C:user/Desktop//pictures/Sequence/%02d.jpg"); VideoCapture sequence(arg);
if(!sequence.isOpened()) { cout << "Failed to open image sequence" << endl; return -1; }
Mat image; for(;;) { sequence >> image; if(image.empty()) { cout << "End of sequence" << endl; break; } imageQueue.push_back(image); }
for(int i = 0; i < 10; i++) { //display 10 images Mat readImage; readImage = imageQueue[i]; namedWindow("Current Image", CV_WINDOW_AUTOSIZE); imshow("Current Image", readImage); waitKey(100); }
return 0; }