10 #include "../lib/args.h" 11 #include "../lib/misc.h" 12 #include "../lib/dataset.h" 13 #include "../lib/json.h" 18 int main(
int argc,
const char* argv[]) {
19 get_args(argc, argv,
"dataset_parameters.json in_cors.json depths.txt [y_index]");
25 if(datas.
is_2d() && y == -1)
throw std::runtime_error(
"must specify y index for 2D dataset");
27 std::cout <<
"saving feature depths" << std::endl;
28 std::ofstream depths_stream(depths_filename);
31 for(
int x : datas.
x_indices()) depths_stream <<
' ' << x;
32 depths_stream <<
'\n';
34 for(
const auto& kv : cors.
features) {
35 const std::string& feature_name = kv.first;
37 depths_stream << feature_name;
42 auto pt_it = feature.
points.find(view_idx);
43 if(pt_it == feature.
points.end())
continue;
47 if(depth != 0.0) depths_stream << depth;
49 depths_stream <<
'\n';
51 std::cout <<
"done" << std::endl;
long int_opt_arg(long def)
Set of features, each on set of views.
std::map< std::string, image_correspondence_feature > features
std::vector< int > x_indices() const
int main(int argc, const char *argv[])
image_correspondences image_correspondences_arg()
std::string out_filename_arg()
Feature on set of views. Optionally one view is "reference".
std::map< view_index, feature_point > points
void get_args(int argc, const char *argv[], const std::string &usage)