-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathconfig_parser.h
More file actions
114 lines (102 loc) · 4.21 KB
/
config_parser.h
File metadata and controls
114 lines (102 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/** vpr_relocalization: a library for visual place recognition in changing
** environments with efficient relocalization step.
** Copyright (c) 2017 O. Vysotska, C. Stachniss, University of Bonn
**
** Permission is hereby granted, free of charge, to any person obtaining a copy
** of this software and associated documentation files (the "Software"), to deal
** in the Software without restriction, including without limitation the rights
** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
** copies of the Software, and to permit persons to whom the Software is
** furnished to do so, subject to the following conditions:
**
** The above copyright notice and this permission notice shall be included in
** all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
** SOFTWARE.
**/
#ifndef SRC_TOOLS_CONFIG_PARSER_CONFIG_PARSER_H_
#define SRC_TOOLS_CONFIG_PARSER_CONFIG_PARSER_H_
#include <string>
/**
* @brief Class for storing the configuration parameters.
*/
class ConfigParser {
public:
ConfigParser() {}
bool parse(const std::string &iniFile);
bool parseYaml(const std::string &yamlFile);
void print() const;
std::string path2qu = "";
std::string path2ref = "";
std::string path2quImg = "";
std::string path2refImg = "";
std::string imgExt = "";
std::string costMatrix = "";
std::string costsOutputName = "costs.MatchingCosts.pb";
std::string simPlaces = "";
std::string hashTable = "";
std::string matchingResult = "matches.MatchingResult.pb";
int querySize = -1;
int fanOut = -1;
int bufferSize = -1;
double nonMatchCost = -1.0;
double expansionRate = -1.0;
};
/*! \var std::string ConfigParser::path2qu
\brief stores path to the folder with query features.
*/
/*! \var std::string ConfigParser::path2ref
\brief stores path to the folder with reference features.
*/
/*! \var std::string ConfigParser::path2quImg
\brief stores path to the folder with query images.
*/
/*! \var std::string ConfigParser::path2refImg
\brief stores path to the folder with reference images.
*/
/*! \var std::string ConfigParser::imgExt
\brief stores the extension of the provided images (".jpg", ".png", etc).
*/
/*! \var std::string ConfigParser::costMatrix
\brief stores path to precomputed cost/similarity matrix.
*/
/*! \var std::string ConfigParser::costsOutputName
\brief stores the name of the produced result for the cost_matrix_based
matching.
*/
/*! \var std::string ConfigParser::hashTable
\brief stores the name of the file to read hash table from.
matching.
*/
/*! \var int ConfigParser::querySize
\brief stores number of query images.
*/
/*! \var int ConfigParser::fanOut
\brief stores the fan out parameter, number of children each node in the
graph can have. Represents possible difference in speed of moving cameras or
frame rate.
*/
/*! \var int ConfigParser::bufferSize
\brief number of image features to be cached. Speeds up the computation for
feature_based matching. Irrelevant for cost_matrix_based matching.
*/
/*! \var double ConfigParser::nonMatchCost
\brief maximum boundary for the matching cost to still be considered as a
match. For example, if `nonMatchCost = 5.0` then every smaller cost should
represent the fact that 2 images match and every higher cost represents the
fact that 2 image descriptors do not represent the same place. (sensitive
parameter, depends on the matched trajectories).
*/
/*! \var double ConfigParser::expansionRate
\brief a weighting parameter [0,1], which controls the expansion/reduction
of the graph. 0 - expands the graph that corresponds to the full matching
matrix. 1 - approaches the greedy search. Not a sensitive parameter, should
typically be selected from 0.5 - 0.7.
*/
#endif // SRC_TOOLS_CONFIG_PARSER_CONFIG_PARSER_H_