1 #include "../lib/common.h" 2 #include "../lib/obj_img_correspondence.h" 3 #include "../lib/json.h" 4 #include "../lib/args.h" 9 int main(
int argc,
const char* argv[]) {
10 get_args(argc, argv,
"in1.json in2.json out.json [1/2]");
22 if(dim1.
obj_count != 1 || dim2.
obj_count != 1)
throw std::runtime_error(
"unsupported dims (obj_count != 1)");
28 out_set.insert(out_set.end(), set2.cbegin(), set2.cend());
34 out_set.insert(out_set.end(), set2.cbegin(), set2.cend());
40 for(
const auto& cors :
set) {
41 out_set.emplace_back();
42 auto& out_cors = out_set.back();
43 for(
const auto& cor : cors) {
44 out_cors.emplace_back();
45 auto& out_cor = out_cors.back();
46 out_cor.object_coordinates[0] = cor.object_coordinates[0];
47 out_cor.image_coordinates[0] = cor.image_coordinates[which];
56 insert_from_double(set1, which);
57 out_set.insert(out_set.end(), set2.cbegin(), set2.cend());
63 out_set.insert(out_set.end(), set1.cbegin(), set1.cend());
64 insert_from_double(set2, which);
66 throw std::runtime_error(
"unsupported dims");
71 throw std::runtime_error(
"unsupported dims");
long int_opt_arg(long def)
std::string in_filename_arg()
int main(int argc, const char *argv[])
void export_json_file(const json &j, const std::string &filename, bool compact)
obj_img_correspondences_set_dim decode_obj_img_correspondences_set_dim(const json &j_set)
std::string out_filename_arg()
json encode_obj_img_correspondences_set(const obj_img_correspondences_set< Obj_count, Img_count > &)
json import_json_file(const std::string &filename)
std::vector< obj_img_correspondences< Obj_count, Img_count >> obj_img_correspondences_set
void get_args(int argc, const char *argv[], const std::string &usage)