Global image counting
Is useful later for when we want to know our progress
This commit is contained in:
@@ -46,15 +46,16 @@ void DescriptorManager::Init() {
|
||||
}
|
||||
fs::ifstream ifs;
|
||||
fs::ofstream ofs;
|
||||
int cnt = std::count_if(
|
||||
numImages = std::count_if(
|
||||
fs::directory_iterator(img_path),
|
||||
fs::directory_iterator(),
|
||||
static_cast<bool(*)(const fs::path&)>(fs::is_regular_file));
|
||||
//foreach image in directory (non-recursive)
|
||||
int filecount = 0;
|
||||
for (fs::directory_iterator itr(img_path); itr != fs::directory_iterator(); ++itr) {
|
||||
cout << "\r" << "Progress: " << filecount++*100/cnt << "% - (" << filecount << "/" << cnt << ")" << flush;
|
||||
cout << "\r" << "Progress: " << filecount*100/numImages << "% - (" << filecount << "/" << numImages << ")" << flush;
|
||||
if (!itr->path().has_extension()) continue; //skip directories and such
|
||||
filecount++;
|
||||
string image_name = itr->path().filename().generic_string();
|
||||
Image* image = new Image;
|
||||
image->read(itr->path().string());
|
||||
|
||||
Reference in New Issue
Block a user