slight updated ir_affine

pull/84/head
dmitriy.anisimov 10 years ago
parent 4000b35dbe
commit 5624ad2c8e
  1. 2
      modules/datasetstools/CMakeLists.txt
  2. 16
      modules/datasetstools/src/ir_affine.cpp

@ -1,3 +1,3 @@
set(the_description "datasets tools")
ocv_define_module(datasetstools opencv_core)
ocv_define_module(datasetstools opencv_core opencv_features2d)

@ -78,13 +78,27 @@ void IR_affineImp::loadDataset(const string &path)
test.push_back(vector< Ptr<Object> >());
validation.push_back(vector< Ptr<Object> >());
// detect image extension
string ext;
vector<string> fileNames;
getDirList(path, fileNames);
for (vector<string>::iterator it=fileNames.begin(); it!=fileNames.end(); ++it)
{
string &name = *it;
if (name.length()>=8 && name.substr(0, 3)=="img")
{
ext = name.substr(name.length()-4, 4);
break;
}
}
for (unsigned int i=1; i<=6; ++i)
{
Ptr<IR_affineObj> curr(new IR_affineObj);
char tmp[2];
sprintf(tmp, "%u", i);
curr->imageName = path + "img" + tmp + ".ppm";
curr->imageName = path + "img" + tmp + ext;
if (i>1)
{

Loading…
Cancel
Save