From 1e1737006fd73c7937c188b168f8e9f314a99e73 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Mon, 7 Jan 2013 17:14:27 +0100 Subject: [PATCH] get slightly more flexibility in the naming convention --- src/rgbd/samples/reconst3d/load_data.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rgbd/samples/reconst3d/load_data.cpp b/src/rgbd/samples/reconst3d/load_data.cpp index ae42ce2..0fe222d 100644 --- a/src/rgbd/samples/reconst3d/load_data.cpp +++ b/src/rgbd/samples/reconst3d/load_data.cpp @@ -38,13 +38,15 @@ void loadTODLikeBase(const string& dirname, vector& bgrImages, vector& readDirectory(dirname, allFilenames, false); vector imageIndices; + imageIndices.reserve(allFilenames.size()); for(size_t i = 0; i < allFilenames.size(); i++) { const string& imageFilename = allFilenames[i]; - if(imageFilename.size() != 15) - continue; + // image_* and .png is at least 11 character + if (imageFilename.size() < 11) + continue; - const string imageIndex = imageFilename.substr(6, 5); + const string imageIndex = imageFilename.substr(6, imageFilename.length() - 6 - 4); if(imageFilename.substr(0, 6) == "image_" && imageIndex.find_first_not_of("0123456789") == std::string::npos &&