Main MRPT website > C++ reference for MRPT 1.9.9
heuristicParams.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /* Plane-based Map (PbMap) library
11  * Construction of plane-based maps and localization in it from RGBD Images.
12  * Writen by Eduardo Fernandez-Moral. See docs for <a
13  * href="group__mrpt__pbmap__grp.html" >mrpt-pbmap</a>
14  */
15 
16 #ifndef __HEURISTICPARAMS_H
17 #define __HEURISTICPARAMS_H
18 
20 #include <mrpt/system/filesystem.h>
21 
22 namespace mrpt
23 {
24 namespace pbmap
25 {
26 /** A class used to define the heuristic parameters and thresholds used to match
27  * sets of planes.
28  * These parameters are loaded from a configuration file.
29  *
30  * \ingroup mrpt_pbmap_grp
31  */
33 {
34  // [global]
35  /*! Global parameter to indicate the path to previous PbMaps used for place
36  * recognition*/
38 
39  /*! Global parameter indicating the minimum required plane matches for place
40  * recognition*/
41  unsigned min_planes_recognition; // Minimum number of planes to accept a
42  // match between two neighborhoods of
43  // planes
44  bool use_structure; // Use inferred knowledge
45  bool use_completeness; // Use inferred knowledge
46 
47  // [unary]
48  /*! Unary constraint threshold to limit the difference of distances between
49  * two pairs camera-plane (to be used in odometry, i.e. when the two cameras
50  * are nearby */
51  float dist_d;
52  float angle;
53 
57  // float colorDev_threshold;
61  area_half_threshold_inv; // Constraint with "half confidence": one
62  // plana is fully observed
63  float elongation_threshold, elongation_threshold_inv; // Unary constraint:
64  int graph_mode; // This var selects the condition to create edges in the
65  // graph, either proximity of planar patches or
66  // co-visibility in a single frame
67 
68  // [binary]
69  /*! Binary constraint threshold to limit the difference of distances between
70  * the centers of two pair of planes. This threashold should be loose if the
71  * plane boundaries are not known, which is the most common situation */
73  float angle_threshold; // Binary constraint: the angle between the normals
74  // of two pair of planes
75  float height_threshold; // Binary constraint: Height from one plane wrt a
76  // neighbor (in meters)
77  float height_threshold_parallel; // Binary constraint: Height from one
78  // plane wrt a neighbor (in meters) for
79  // complete marked planes
81 
82  /*! Load the PbMap registration thresholds from an .ini file */
83  void load_params(const std::string& config_file_name)
84  {
85  ASSERT_FILE_EXISTS_(config_file_name);
86  mrpt::config::CConfigFile config_file(config_file_name);
87 
88  // global
90  config_file.read_string("global", "path_prev_pbmaps", "", false);
91  // std::cout << path_prev_pbmaps << std::endl;
92  use_structure = config_file.read_bool("global", "use_structure", true);
94  config_file.read_bool("global", "use_completeness", true);
96  config_file.read_int("global", "min_planes_recognition", 4);
97  graph_mode = config_file.read_int("global", "graph_mode", 1);
98 
99  // Unary constraints
100  dist_d = config_file.read_float("unary", "dist_d", 0.5);
101  angle = config_file.read_float("unary", "angle", 50);
102  angle = cos(angle * 3.14159 / 180);
103 
105  config_file.read_float("unary", "color_threshold", 0.09);
107  config_file.read_float("unary", "intensity_threshold", 175.0);
108  hue_threshold = config_file.read_float("unary", "hue_threshold", 0.3);
109  // colorDev_threshold =
110  // config_file.read_float("unary","colorDev_threshold",0.005);
111  area_threshold = config_file.read_float("unary", "area_threshold", 3.0);
114  config_file.read_float("unary", "area_full_threshold", 1.6);
117  config_file.read_float("unary", "area_half_threshold", 2.0);
120  config_file.read_float("unary", "elongation_threshold", 2.9);
122 
123  // Binary constraints
125  config_file.read_float("binary", "dist_threshold", 2.0);
128  config_file.read_float("binary", "angle_threshold", 7.0);
130  config_file.read_float("binary", "height_threshold", 0.2);
132  config_file.read_float("binary", "height_threshold_parallel", 0.2);
134  config_file.read_float("binary", "cos_angle_parallel", 0.985);
135  };
136 
137  /*! Print the threshold for registration */
139  {
140  using std::cout;
141  using std::endl;
142 
143  cout << "Unary thresholds:\n";
144  cout << "dist_d " << dist_d << endl;
145  cout << "angle " << angle << endl;
146  cout << "color_threshold " << color_threshold << endl;
147  cout << "intensity_threshold " << intensity_threshold << endl;
148  cout << "hue_threshold " << hue_threshold << endl;
149  cout << "area_threshold " << area_threshold << endl;
150  cout << "elongation_threshold " << elongation_threshold << endl;
151 
152  cout << "Binary thresholds:\n";
153  cout << "angle_threshold " << angle_threshold << endl;
154  cout << "angle " << angle << endl;
155  cout << "height_threshold " << height_threshold << endl;
156  };
157 };
158 } // namespace pbmap
159 } // namespace mrpt
160 
161 #endif
mrpt::pbmap::config_heuristics::area_full_threshold
float area_full_threshold
Definition: heuristicParams.h:59
filesystem.h
mrpt::pbmap::config_heuristics::dist_threshold
float dist_threshold
Definition: heuristicParams.h:72
mrpt::pbmap::config_heuristics::height_threshold_parallel
float height_threshold_parallel
Definition: heuristicParams.h:77
mrpt::pbmap::config_heuristics::dist_threshold_inv
float dist_threshold_inv
Definition: heuristicParams.h:72
mrpt::pbmap::config_heuristics::intensity_threshold
float intensity_threshold
Definition: heuristicParams.h:55
mrpt::pbmap::config_heuristics::hue_threshold
float hue_threshold
Definition: heuristicParams.h:56
mrpt::pbmap::config_heuristics::area_threshold
float area_threshold
Definition: heuristicParams.h:58
CConfigFile.h
mrpt::pbmap::config_heuristics::angle_threshold
float angle_threshold
Definition: heuristicParams.h:73
mrpt::pbmap::config_heuristics::elongation_threshold_inv
float elongation_threshold_inv
Definition: heuristicParams.h:63
mrpt::config::CConfigFileBase::read_bool
bool read_bool(const std::string &section, const std::string &name, bool defaultValue, bool failIfNotFound=false) const
Definition: CConfigFileBase.cpp:150
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::pbmap::config_heuristics::path_prev_pbmaps
std::string path_prev_pbmaps
Definition: heuristicParams.h:37
mrpt::pbmap::config_heuristics
A class used to define the heuristic parameters and thresholds used to match sets of planes.
Definition: heuristicParams.h:32
mrpt::config::CConfigFileBase::read_string
std::string read_string(const std::string &section, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
Definition: CConfigFileBase.cpp:169
mrpt::pbmap::config_heuristics::print_params
void print_params()
Definition: heuristicParams.h:138
mrpt::config::CConfigFileBase::read_int
int read_int(const std::string &section, const std::string &name, int defaultValue, bool failIfNotFound=false) const
Definition: CConfigFileBase.cpp:125
mrpt::pbmap::config_heuristics::load_params
void load_params(const std::string &config_file_name)
Definition: heuristicParams.h:83
mrpt::pbmap::config_heuristics::area_full_threshold_inv
float area_full_threshold_inv
Definition: heuristicParams.h:59
mrpt::pbmap::config_heuristics::area_half_threshold_inv
float area_half_threshold_inv
Definition: heuristicParams.h:61
mrpt::pbmap::config_heuristics::min_planes_recognition
unsigned min_planes_recognition
Definition: heuristicParams.h:41
mrpt::pbmap::config_heuristics::area_threshold_inv
float area_threshold_inv
Definition: heuristicParams.h:58
mrpt::pbmap::config_heuristics::angle
float angle
Definition: heuristicParams.h:52
mrpt::pbmap::config_heuristics::color_threshold
float color_threshold
Definition: heuristicParams.h:54
mrpt::pbmap::config_heuristics::cos_angle_parallel
float cos_angle_parallel
Definition: heuristicParams.h:80
mrpt::config::CConfigFileBase::read_float
float read_float(const std::string &section, const std::string &name, float defaultValue, bool failIfNotFound=false) const
Definition: CConfigFileBase.cpp:113
mrpt::pbmap::config_heuristics::use_structure
bool use_structure
Definition: heuristicParams.h:44
mrpt::pbmap::config_heuristics::elongation_threshold
float elongation_threshold
Definition: heuristicParams.h:63
mrpt::config::CConfigFile
This class allows loading and storing values and vectors of different types from "....
Definition: config/CConfigFile.h:33
mrpt::pbmap::config_heuristics::graph_mode
int graph_mode
Definition: heuristicParams.h:64
mrpt::pbmap::config_heuristics::height_threshold
float height_threshold
Definition: heuristicParams.h:75
mrpt::pbmap::config_heuristics::dist_d
float dist_d
Definition: heuristicParams.h:51
string
GLsizei const GLchar ** string
Definition: glext.h:4101
ASSERT_FILE_EXISTS_
#define ASSERT_FILE_EXISTS_(FIL)
Definition: filesystem.h:22
mrpt::pbmap::config_heuristics::use_completeness
bool use_completeness
Definition: heuristicParams.h:45
mrpt::pbmap::config_heuristics::area_half_threshold
float area_half_threshold
Definition: heuristicParams.h:60



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST