ext/kintinuous/kfusion/src/app/Options.cpp
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.cpp
22  *
23  * Created on: Nov 21, 2010
24  * Author: Thomas Wiemann
25  */
26 
27 #include <kfusion/Options.hpp>
28 #include <lvr/config/lvropenmp.hpp>
29 
30 namespace kfusion{
31 
32 Options::Options(int argc, char** argv) : m_descr("Supported options")
33 {
34 
35  // Create option descriptions
36 
37  m_descr.add_options()
38  ("help", "Produce help message")
39  ("device,i", value(&m_device)->default_value("0"), "set RGB-D device or either a path to an oni file")
40  ("output,s", value(&m_mesh_name)->default_value("mesh_output"), "filename to save reconstructed mesh (.ply or .obj will be added (obj with textures))")
41  ("textures,t", "live texturizing the mesh")
42  ("shiftingDistance", value<float>(&m_shifting_distance)->default_value(0.4), " distance in meters of how far the volume is shifted")
43  ("cameraOffset", value<float>(&m_cam_offset)->default_value(0.7), "offset of the camera from the volume center in z dimension")
44  ("no_reconstruct,r", "set for no reconstruction, just recording")
45  ("optimizePlanes,o", "set for live mesh optimization")
46  ("no_vizualisation,v", "set for no live vizualisation, because it reduces gpu performance on really large scale reconstructions")
47  ("clusterPlanes,c", "Cluster planar regions based on normal threshold, do not shift vertices into regression plane.")
48  ("cleanContours", value<int>(&m_cleanContourIterations)->default_value(0), "Remove noise artifacts from contours. Same values are between 2 and 4")
49  ("planeIterations", value<int>(&m_planeIterations)->default_value(7), "Number of iterations for plane optimization")
50  ("fillHoles,f", value<int>(&m_fillHoles)->default_value(30), "Maximum size for hole filling")
51  ("rda", value<int>(&m_rda)->default_value(0), "Remove dangling artifacts, i.e. remove the n smallest not connected surfaces")
52  ("pnt", value<float>(&m_planeNormalThreshold)->default_value(0.98), "(Plane Normal Threshold) Normal threshold for plane optimization. Default 0.85 equals about 3 degrees.")
53  ("smallRegionThreshold", value<int>(&m_smallRegionThreshold)->default_value(0), "Threshold for small region removal. If 0 nothing will be deleted.")
54  ("mp", value<int>(&m_minPlaneSize)->default_value(7), "Minimum value for plane optimzation")
55  ("lft", value<float>(&m_lineFusionThreshold)->default_value(0.008), "(Line Fusion Threshold) Threshold for fusing line segments while tesselating.")
56  ("classifier", value<string>(&m_classifier)->default_value("PlaneSimpsons"),"Classfier object used to color the mesh.")
57  ("depth", value<int>(&m_depth)->default_value(100), "Maximum recursion depth for region growing.")
58  ("verbose", "set for verbose output.")
59  ("threads", value<int>(&m_numThreads)->default_value( lvr::OpenMPConfig::getNumThreads() ), "Number of threads")
60  ;
61 
62  //m_pdescr.add("device", -1);
63 
64  // Parse command line and generate variables map
65  store(command_line_parser(argc, argv).options(m_descr).positional(m_pdescr).run(), m_variables);
66  notify(m_variables);
67 
68  if(m_variables.count("help")) {
69  ::std::cout<< m_descr << ::std::endl;
70  }
71 
72 }
73 
75 {
76  return m_variables["threads"].as<int>();
77 }
78 
79 
81 {
82  return m_variables["planeIterations"].as<int>();
83 }
84 
86 {
87  return (m_variables["device"].as<string>());
88 }
89 
90 string Options::getOutput() const
91 {
92  return (m_variables["output"].as<string>());
93 }
94 
95 string Options::getClassifier() const
96 {
97  return (m_variables["classifier"].as< string >());
98 }
99 
101 {
102  return (m_variables["rda"].as<int> ());
103 }
104 
106 {
107  return (m_variables["shiftingDistance"].as<float> ());
108 }
109 
111 {
112  return (m_variables["cameraOffset"].as<float> ());
113 }
114 
116 {
117  return (m_variables["fillHoles"].as<int> ());
118 }
119 
121 {
122  return (m_variables["mp"].as<int> ());
123 }
124 
125 
127 {
128  if(m_variables.count("help"))
129  {
130  cout << endl;
131  cout << m_descr << endl;
132  return true;
133  }
134  return false;
135 }
136 
137 
139 {
140  return m_variables.count("optimizePlanes");
141 }
142 
143 bool Options::textures() const
144 {
145  return m_variables.count("textures") &&
146  m_variables.count("optimizePlanes");
147 }
148 
150 {
151  return m_variables.count("no_vizualisation") ||
152  m_variables.count("no_reconstruct");
153 }
154 
156 {
157  return m_variables.count("no_reconstruct");
158 }
159 
160 bool Options::verbose() const
161 {
162  return m_variables.count("verbose");
163 }
164 
166 {
167  return m_variables.count("clusterPlanes");
168 }
169 
171 {
172  return m_variables.count("colorRegions");
173 }
174 
175 
177 {
178  return m_variables["pnt"].as<float>();
179 }
180 
182 {
183  return m_variables["smallRegionThreshold"].as<int>();
184 }
185 
187 {
188  return m_variables["cleanContours"].as<int>();
189 }
190 
191 
192 int Options::getDepth() const
193 {
194  return m_depth;
195 }
196 
198 {
199  return m_variables["lft"].as<float>();
200 }
201 
203  // TODO Auto-generated destructor stub
204 }
205 
206 } // namespace meshopt
207 
int m_smallRegionThreshold
Threshold for small ragions.
options_description m_descr
The internally used option description.
int m_minPlaneSize
Threshold for plane optimization.
bool colorRegions() const
Returns true of region coloring is enabled.
const kaboom::Options * options
int getDepth() const
Returns the maximum recursion depth for region growing.
string getInputDevice() const
Returns the output file name.
int m_rda
Number of dangling artifacts to remove.
int getCleanContourIterations() const
Number of iterations for contour cleanup.
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
int getMinPlaneSize() const
Minimum value for plane optimzation.
int m_depth
Maximum recursion depth for region growing.
bool clusterPlanes() const
True if region clustering without plane optimization is required.
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
int m_numThreads
The number of uesed threads.
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.
bool printUsage() const
Prints a usage message to stdout.
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.
string getClassifier() const
Returns the name of the classifier used to color the mesh.
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
float getLineFusionThreshold() const
Returns the fusion threshold for tesselation.


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