licornea_tools
feature_slopes.h
Go to the documentation of this file.
1 #ifndef LICORNEA_CG_FEATURE_SLOPES_H_
2 #define LICORNEA_CG_FEATURE_SLOPES_H_
3 
4 #include "../../../lib/json.h"
5 #include "../../../lib/args.h"
6 #include "../../../lib/border.h"
7 #include "../feature_points.h"
8 #include <map>
9 #include <string>
10 
11 namespace tlz {
12 
13 
14 struct feature_slope {
16  real vertical = NAN;
17 };
19  // feature points are undistorted
20  // can contain feature points from multiple views
21 
22  std::map<std::string, feature_slope> slopes;
23 
24  feature_slopes() = default;
25  explicit feature_slopes(const feature_points&);
26 };
27 
29 bool has_feature_slopes(const json&);
30 
32 
33 real model_horizontal_slope(const vec2& undistorted_point, const mat33& K, const mat33& R);
34 real model_vertical_slope(const vec2& undistorted_point, const mat33& K, const mat33& R);
35 
37 
38 cv::Mat_<cv::Vec3b> visualize_feature_slopes(const feature_slopes&, const cv::Mat_<cv::Vec3b>& back_img, int width = 200, real exaggeration = 1.0, int thickness = 2, const border& = border());
39 
41 
42 
43 }
44 
45 #endif
json encode_feature_slopes(const feature_slopes &fslopes)
bool has_feature_slopes(const json &j_fslopes)
const int border
real model_vertical_slope(const vec2 &undistorted_point, const mat33 &K, const mat33 &R)
real model_horizontal_slope(const vec2 &undistorted_point, const mat33 &K, const mat33 &R)
Points of different features, on one view.
feature_slopes feature_slopes_arg()
cv::Vec< real, 2 > vec2
Definition: common.h:22
cv::Mat_< cv::Vec3b > visualize_feature_slopes(const feature_slopes &fslopes, const cv::Mat_< cv::Vec3b > &back_img, int width, real exaggeration, int thickness, const border &bord)
cv::Matx< real, 3, 3 > mat33
Definition: common.h:26
double real
Definition: common.h:16
feature_slopes decode_feature_slopes(const json &j_fslopes)
std::map< std::string, feature_slope > slopes
feature_slopes merge_multiview_feature_slopes(const feature_slopes &a, const feature_slopes &b)
nlohmann::json json
Definition: json.h:11