vs2017 C++ openCV
//从输入序号开始保存,例tif文件夹有1-3tif文件,输入4;遍历tiftemp,提取所有tif文件名改为4.tiff到tif文件夹;
string str=”d:/tiftemp/”;
vector<String> filenames;
int age, age1;
cout << “namefile” << endl;
cin >> age;
glob(str, filenames);
for (int i = 0; i < filenames.size(); ++i)
{
age1 = age;
age1 += i;
str = “d:/tif/”;
str += to_string(age1);
str += “.tiff”;
std::cout << filenames[i] << endl << str << endl;
rename(filenames[i].c_str(), str.c_str());
}
//其它类型文件没试过,可以用bat修改后缀;