ext/kintinuous/kfusion/include/kfusion/Options.hpp
Go to the documentation of this file.
1 /* Copyright (C) 2011 Uni Osnabrück
2  * This file is part of the LAS VEGAS Reconstruction Toolkit,
3  *
4  * LAS VEGAS is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * LAS VEGAS is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
17  */
18 
19 
20  /*
21  * Options.hpp
22  *
23  * Created on: Sep 17, 2015
24  * Author: Thomas Wiemann
25  * Author: Tristan Igelbrink
26  */
27 
28 #ifndef OPTIONS_H_
29 #define OPTIONS_H_
30 
31 #include <iostream>
32 #include <string>
33 #include <vector>
34 #include <boost/program_options.hpp>
35 
36 using std::ostream;
37 using std::cout;
38 using std::endl;
39 using std::string;
40 using std::vector;
41 
42 
43 namespace kfusion{
44 
45 using namespace boost::program_options;
46 
51 class Options {
52 public:
53 
58  Options(int argc, char** argv);
59  virtual ~Options();
60 
64  int getNumThreads() const;
65 
69  bool printUsage() const;
70 
74  bool colorRegions() const;
75 
79  bool optimizePlanes() const;
80 
81  bool textures() const;
82 
83  bool noVizualisation() const;
84 
85  bool noReconstruction() const;
86 
87  bool verbose() const;
88 
92  bool clusterPlanes() const;
93 
97  string getInputDevice() const;
98 
99  string getOutput() const;
100 
104  string getClassifier() const;
105 
109  int getPlaneIterations() const;
110 
114  float getNormalThreshold() const;
115 
120  int getSmallRegionThreshold() const;
121 
125  int getMinPlaneSize() const;
126 
130  int getCleanContourIterations() const;
131 
136  int getDanglingArtifacts() const;
137 
141  int getFillHoles() const;
142 
143  float getShiftingDistance() const;
144 
145  float getCameraOffset() const;
146 
150  int getDepth() const;
151 
155  float getLineFusionThreshold() const;
156 
157 
158 private:
159 
160  string m_device ;
161  string m_mesh_name;
164  bool m_no_viz;
169 
171  variables_map m_variables;
172 
174  options_description m_descr;
175 
177  positional_options_description m_pdescr;
178 
181 
184 
187 
190 
192  int m_rda;
193 
196 
199 
201  int m_depth;
202 
204 
207 
209  string m_classifier;
210 
211 };
212 
213 
215 inline ostream& operator<<(ostream& os, const Options &o)
216 {
217  cout << "##### Program options: " << endl;
218 
219  cout << "##### Number of threads \t\t: " << o.getNumThreads() << endl;
220 
221 
222  cout << "##### Using Device \t\t\t: " << o.getInputDevice() << endl;
223  cout << "##### Saving mesh to \t\t\t: " << o.getOutput() << endl;
224  cout << "##### Using shifting distance \t\t: " << o.getShiftingDistance() << endl;
225  cout << "##### Using camera offset \t\t: " << o.getCameraOffset() << endl;
226 
227  if(o.noVizualisation())
228  {
229  cout << "##### Live visualization \t\t: NO" << endl;
230  }
231  else
232  cout << "##### Live visualization \t\t: YES" << endl;
233 
234  if(o.noReconstruction())
235  {
236  cout << "##### Online reconstruction \t\t: NO" << endl;
237  }
238  else
239  cout << "##### Online reconstruction \t\t: YES" << endl;
240 
241  if(o.getFillHoles())
242  {
243  cout << "##### Fill holes \t\t\t: " << o.getFillHoles() << endl;
244  }
245  else
246  {
247  cout << "##### Fill holes \t\t\t: NO" << endl;
248  }
249 
250  if(o.getDanglingArtifacts())
251  {
252  cout << "##### Remove DAs \t\t\t: " << o.getDanglingArtifacts() << endl;
253  }
254  else
255  {
256  cout << "##### Remove DAs \t\t\t: NO" << endl;
257  }
258 
259  if(o.optimizePlanes())
260  {
261  cout << "##### Optimize Planes \t\t\t: YES" << endl;
262  cout << "##### Plane iterations \t\t\t: " << o.getPlaneIterations() << endl;
263  cout << "##### Normal threshold \t\t\t: " << o.getNormalThreshold() << endl;
264  cout << "##### Region threshold \t\t\t: " << o.getSmallRegionThreshold() << endl;
265  }
266  if(o.textures())
267  cout << "##### Live texturing \t\t\t: YES" << endl;
268  else
269  cout << "##### Live texturing \t\t\t: NO" << endl;
270  if(o.getDepth())
271  {
272  cout << "##### Recursion depth \t\t\t: " << o.getDepth() << endl;
273  }
274  if(o.verbose())
275  {
276  cout << "##### Verbose output \t\t\t: YES" << endl;
277  }
278  return os;
279 }
280 
281 } // namespace reconstruct
282 
283 
284 #endif /* OPTIONS_H_ */
int m_smallRegionThreshold
Threshold for small ragions.
options_description m_descr
The internally used option description.
int m_minPlaneSize
Threshold for plane optimization.
int getDepth() const
Returns the maximum recursion depth for region growing.
A class to parse the program options for the reconstruction executable.
string getInputDevice() const
Returns the output file name.
int m_rda
Number of dangling artifacts to remove.
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
int m_depth
Maximum recursion depth for region growing.
int m_numberOfDefaults
The number of used default values.
int m_numThreads
The number of uesed threads.
ostream & operator<<(ostream &os, const Options &o)
Overlaoeded outpur operator.
int getSmallRegionThreshold() const
Returns the threshold for the size of small region deletion after plane optimization.
int getFillHoles() const
Returns the region threshold for hole filling.
variables_map m_variables
The internally used variable map.
string m_classifier
Name of the classifier object to color the mesh.
int getPlaneIterations() const
Returns to number plane optimization iterations.
Utility.
Definition: capture.hpp:8
int getDanglingArtifacts() const
Returns the number of dangling artifacts to remove from a created mesh.
int m_planeIterations
Number of iterations for plane optimzation.
float getNormalThreshold() const
Returns the normal threshold for plane optimization.
int getNumThreads() const
Returns the number of used threads.
bool optimizePlanes() const
Returns true if cluster optimization is enabled.
float m_planeNormalThreshold
Threshold for plane optimization.
positional_options_description m_pdescr
The internally used positional option desription.
char ** argv


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:08