licornea_tools
image_correspondence.h
Go to the documentation of this file.
1 #ifndef LICORNEA_IMAGE_CORRESPONDENCE_H_
2 #define LICORNEA_IMAGE_CORRESPONDENCE_H_
3 
4 #include "../../lib/json.h"
5 #include "../../lib/dataset.h"
6 #include "../../lib/args.h"
7 #include "../../lib/intrinsics.h"
8 #include "feature_point.h"
9 #include <map>
10 #include <vector>
11 #include <utility>
12 #include <set>
13 
14 namespace tlz {
15 
16 
20  std::map<view_index, feature_point> points;
21  // when iterating (--> encoding into json array), gets sorted by index
22 
23  bool has(view_index idx) const
24  { return (points.find(idx) != points.end()); }
25 };
26 
29  std::string dataset_group;
30  std::map<std::string, image_correspondence_feature> features;
31 
32  bool has_feature(const std::string& feature_name) const
33  { return (features.find(feature_name) != features.end()); }
34 };
35 
36 
37 std::set<view_index> get_reference_views_set(const image_correspondences&);
38 std::vector<view_index> get_reference_views(const image_correspondences&);
40 
41 std::set<view_index> get_all_views_set(const image_correspondences&);
42 std::vector<view_index> get_all_views(const image_correspondences&);
43 
44 std::set<std::string> get_feature_names_set(const image_correspondences&);
45 std::vector<std::string> get_feature_names(const image_correspondences&);
46 
47 std::string short_feature_name(const std::string& full_feature_name);
48 
50 
51 cv::Mat_<cv::Vec3b> visualize_view_points(const image_correspondence_feature&, const cv::Mat_<cv::Vec3b>& back_img, const cv::Vec3b& col, int dot_size = 2, const border& = border());
52 cv::Mat_<cv::Vec3b> visualize_view_points_closeup(const image_correspondence_feature&, const cv::Mat_<cv::Vec3b>& img, const cv::Vec3b& col, const view_index& ref, real dots_opacity, const border& = border());
53 
56 
59 
60 void export_binary_image_correspondences(const image_correspondences& cors, const std::string& filename);
62 
63 void export_image_corresponcences(const image_correspondences& cors, const std::string& filename);
64 image_correspondences import_image_correspondences(const std::string& filename);
65 
67 
68 }
69 
70 #endif
cv::Mat_< cv::Vec3b > visualize_view_points(const image_correspondence_feature &feature, const cv::Mat_< cv::Vec3b > &back_img, const cv::Vec3b &col, int dot_radius, const border &bord)
std::string short_feature_name(const std::string &full_feature_name)
std::set< std::string > get_feature_names_set(const image_correspondences &cors)
std::set< view_index > get_all_views_set(const image_correspondences &cors)
cv::Mat_< cv::Vec3b > visualize_view_points_closeup(const image_correspondence_feature &feature, const cv::Mat_< cv::Vec3b > &img, const cv::Vec3b &col, const view_index &ref_idx, real dots_opacity, const border &bord)
std::vector< view_index > get_all_views(const image_correspondences &cors)
const int border
json encode_image_correspondence_feature(const image_correspondence_feature &feat)
bool has_feature(const std::string &feature_name) const
image_correspondences import_image_correspondences(const std::string &filename)
image_correspondences image_correspondences_with_reference(const image_correspondences &cors, const view_index &reference_view)
Set of features, each on set of views.
image_correspondence_feature decode_image_correspondence_feature(const json &j_feat)
std::map< std::string, image_correspondence_feature > features
std::vector< view_index > get_reference_views(const relative_camera_positions &rcpos)
std::vector< std::string > get_feature_names(const image_correspondences &cors)
double real
Definition: common.h:16
image_correspondences decode_image_correspondences(const json &j_cors)
void export_binary_image_correspondences(const image_correspondences &cors, const std::string &filename)
image_correspondences image_correspondences_arg()
feature_points undistort(const feature_points &dist_fpoints, const intrinsics &intr)
std::set< view_index > get_reference_views_set(const image_correspondences &cors)
Feature on set of views. Optionally one view is "reference".
bool has(view_index idx) const
void export_image_corresponcences(const image_correspondences &cors, const std::string &filename)
image_correspondences import_binary_image_correspondences(const std::string &filename)
nlohmann::json json
Definition: json.h:11
json encode_image_correspondences(const image_correspondences &cors)
std::map< view_index, feature_point > points