在单张调试图像效果时,可以将算法单次运行,以调试效果。但是,如果图像多到几万张时,我们就需要掌握批量处理图像的方法。在前辈的基础上做了微调。
string gallery_path = "D:\\1.jpg";//批量处理图像的路径
string probe_path = "D:\\……";//处理之后需要批量存入的路径
vector<string> gallery_folders = listDir(gallery_path);
for (int g = 0; g < gallery_folders.size(); g++)
{
//vector<string> image_list = listFile(gallery_path + "\\" + gallery_folders.at(g), "png");
vector<string> image_list = listFile( gallery_folders.at(g), "png");
for (int f = 0; f < image_list.size(); f++)
{
int m = image_list.size();
cout << m << endl;
/*cout << gallery_path + "\\" + gallery_folders.at(g) + "\\" + image_list.at(f) << endl;*/
string ga = gallery_folders.at(g);
cout << "gallery_fo