#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <direct.h>
using namespace std;
int main()
{
string path="D:/faceData/yeleface_group/";
string savepath="D:/faceData/yeleface_group_TT/";
int fnum=15;
int pnum=10;
//_mkdir("D:/faceData/yeleface_group_LTV/1/");
_mkdir(savepath.c_str());
for(int i=0;i<fnum;++i)
{
stringstream f;
f<<savepath<<i+1<<"/";
_mkdir(f.str().c_str());
//cout<<f.str()<<endl;
for(int j=0;j<pnum;++j)
{
stringstream rname;
stringstream wname;
rname<<path<<i+1<<"/"<<j+1<<".jpg";
wname<<savepath<<i+1<<"/"<<j+1<<".jpg";
Mat m_FaceImg=imread(rname.str().c_str(),0);
TT(m_FaceImg,m_FaceImg);
imwrite(wname.str().c_str(),m_FaceImg);
}
}
return 0;
}
C++按文件夹读写图片
最新推荐文章于 2024-03-15 09:55:26 发布