I need to do image sequence after extracting frames.
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. Below is my c++ code. How to do it please?
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;
}
try
imageQueue.push_back(image.clone());