licornea_tools
missing.cc
Go to the documentation of this file.
1 #include "../lib/args.h"
2 #include "../lib/dataset.h"
3 #include "../lib/filesystem.h"
4 #include <fstream>
5 #include <algorithm>
6 #include <cstdlib>
7 #include <sstream>
8 #include <vector>
9 #include <string>
10 
11 using namespace tlz;
12 
13 int main(int argc, const char* argv[]) {
14  get_args(argc, argv, "dataset_parameters.json [dataset_group]");
15  dataset datas = dataset_arg();
16  std::string dataset_group_name = string_opt_arg("");
17 
18  dataset_group datag = datas.group(dataset_group_name);
19 
20  for(view_index idx : datas.indices()) {
21  std::cout << '.' << std::flush;
22  dataset_view view = datag.view(idx);
23  bool have_image = file_exists(view.image_filename());
24  bool have_depth = file_exists(view.depth_filename());
25 
26  if(! have_image) std::cout << "\nmissing image " << idx << " (" << view.image_filename() << ")\n";
27  if(! have_depth) std::cout << "\nmissing depth " << idx << " (" << view.depth_filename() << ")\n";
28  }
29  std::cout << std::endl;
30 }
bool file_exists(const std::string &filename)
std::string image_filename() const
Definition: dataset.cc:64
dataset_view view(int x) const
Definition: dataset.cc:105
std::string depth_filename() const
Definition: dataset.cc:68
dataset dataset_arg()
Definition: dataset.cc:297
int main(int argc, const char *argv[])
Definition: missing.cc:13
dataset_group group(const std::string &grp) const
Definition: dataset.cc:265
std::vector< view_index > indices() const
Definition: dataset.cc:235
std::string string_opt_arg(const std::string &def="")
Definition: args.h:36
void get_args(int argc, const char *argv[], const std::string &usage)
Definition: args.cc:49