licornea_tools
homography_maximal_border.cc
Go to the documentation of this file.
1 #include "../lib/common.h"
2 #include "../lib/args.h"
3 #include "../lib/view_homography.h"
4 #include "../lib/border.h"
5 
6 using namespace tlz;
7 
8 int main(int argc, const char* argv[]) {
9  get_args(argc, argv, "homography.json/homographies.json width height out_border.json");
10  json j = json_arg();
11  int width = int_arg();
12  int height = int_arg();
13  std::string out_border_filename = out_filename_arg();
14 
15  border bord;
18  bord = maximal_border(hom, width, height);
19  } else {
21  bord = maximal_border(homs, width, height);
22  }
23 
24  export_json_file(encode_border(bord), out_border_filename, true);
25 }
view_homography decode_view_homography(const json &j_hom)
bool is_single_view_homography(const json &j)
std::map< view_index, view_homography > view_homographies
json json_arg()
Definition: json.h:34
border maximal_border(const view_homography &hom, real width, real height)
int main(int argc, const char *argv[])
long int_arg()
Definition: args.cc:138
void export_json_file(const json &j, const std::string &filename, bool compact)
Definition: json.cc:9
std::string out_filename_arg()
Definition: args.cc:104
json encode_border(const border &bord)
Definition: border.cc:5
view_homographies decode_view_homographies(const json &j_homs)
nlohmann::json json
Definition: json.h:11
void get_args(int argc, const char *argv[], const std::string &usage)
Definition: args.cc:49