you can use a std::vector containing the path for the group of images.
you can use a function like the below, to fill the vector, with the relative path to the images:
std::vector<std::String> imagelistVector(std::string path)
{
std::vector<std::String> fn;
cv::glob(path,fn,false);
return fn;
}
that makes use of the cv::glob template
the usage e.g.:
vector<String> imglist=imagelistVector("data/*.jpg");
will read all the images with the .jpg extension in the local "data" folder
Then you can use the list to read all the images, by the use of a for loop like that:
for (unsigned int i =0; i<imglist.size(); i++)
{
Mat img = imread(filelist.at(i), CV_LOAD_IMAGE_COLOR);
//do something with each image
}
Or if you want to store all the images:
std::vector<cv::Mat> images;
for (unsigned int i =0; i<imglist.size(); i++)
{
Mat img = imread(filelist.at(i), CV_LOAD_IMAGE_COLOR);
images.push_back(img)
}
//do something with all or a group of images