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 
kfusion::Options::m_descr
options_description m_descr
The internally used option description.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:174
kfusion::Options::noVizualisation
bool noVizualisation() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:149
kfusion::Options::optimizePlanes
bool optimizePlanes() const
Returns true if cluster optimization is enabled.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:138
kfusion::Options::m_planeIterations
int m_planeIterations
Number of iterations for plane optimzation.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:183
kfusion::Options::m_cam_offset
float m_cam_offset
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:165
kfusion::Options::m_depth
int m_depth
Maximum recursion depth for region growing.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:201
kfusion::Options::getFillHoles
int getFillHoles() const
Returns the region threshold for hole filling.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:115
kfusion::Options::getMinPlaneSize
int getMinPlaneSize() const
Minimum value for plane optimzation.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:120
kfusion::Options::getDanglingArtifacts
int getDanglingArtifacts() const
Returns the number of dangling artifacts to remove from a created mesh.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:100
kfusion::Options::noReconstruction
bool noReconstruction() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:155
kfusion::Options::getDepth
int getDepth() const
Returns the maximum recursion depth for region growing.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:192
kfusion::Options::getShiftingDistance
float getShiftingDistance() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:105
kfusion::Options::getInputDevice
string getInputDevice() const
Returns the output file name.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:85
kfusion::Options::getCleanContourIterations
int getCleanContourIterations() const
Number of iterations for contour cleanup.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:186
kfusion::Options::getSmallRegionThreshold
int getSmallRegionThreshold() const
Returns the threshold for the size of small region deletion after plane optimization.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:181
kfusion::Options::m_planeNormalThreshold
float m_planeNormalThreshold
Threshold for plane optimization.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:186
kfusion::Options::m_device
string m_device
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:160
kfusion::Options::m_rda
int m_rda
Number of dangling artifacts to remove.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:192
kfusion::Options::textures
bool textures() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:143
kfusion::Options::m_mesh_name
string m_mesh_name
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:161
options
const kaboom::Options * options
Definition: src/tools/lvr2_kaboom/Main.cpp:45
kfusion
Utility.
Definition: capture.hpp:8
kfusion::Options::m_classifier
string m_classifier
Name of the classifier object to color the mesh.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:209
kfusion::Options::verbose
bool verbose() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:160
Options.hpp
kfusion::Options::m_variables
variables_map m_variables
The internally used variable map.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:171
kfusion::Options::getCameraOffset
float getCameraOffset() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:110
kfusion::Options::m_smallRegionThreshold
int m_smallRegionThreshold
Threshold for small ragions.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:189
argc
int argc
Definition: tests_high_five_parallel.cpp:27
kfusion::Options::~Options
virtual ~Options()
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:202
kfusion::Options::getNumThreads
int getNumThreads() const
Returns the number of used threads.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:74
kfusion::Options::m_numThreads
int m_numThreads
The number of uesed threads.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:168
kfusion::Options::getNormalThreshold
float getNormalThreshold() const
Returns the normal threshold for plane optimization.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:176
kfusion::Options::printUsage
bool printUsage() const
Prints a usage message to stdout.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:126
kfusion::Options::getPlaneIterations
int getPlaneIterations() const
Returns to number plane optimization iterations.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:80
kfusion::Options::m_pdescr
positional_options_description m_pdescr
The internally used positional option desription.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:177
kfusion::Options::m_cleanContourIterations
int m_cleanContourIterations
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:203
kfusion::Options::colorRegions
bool colorRegions() const
Returns true of region coloring is enabled.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:170
kfusion::Options::getClassifier
string getClassifier() const
Returns the name of the classifier used to color the mesh.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:95
kfusion::Options::m_lineFusionThreshold
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:206
kfusion::Options::m_shifting_distance
float m_shifting_distance
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:166
kfusion::Options::m_minPlaneSize
int m_minPlaneSize
Threshold for plane optimization.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:198
kfusion::Options::getLineFusionThreshold
float getLineFusionThreshold() const
Returns the fusion threshold for tesselation.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:197
kfusion::Options::clusterPlanes
bool clusterPlanes() const
True if region clustering without plane optimization is required.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:165
kfusion::Options::Options
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:32
argv
char ** argv
Definition: tests_high_five_parallel.cpp:28
kfusion::Options::getOutput
string getOutput() const
Definition: ext/kintinuous/kfusion/src/app/Options.cpp:90
kfusion::Options::m_fillHoles
int m_fillHoles
Threshold for hole filling.
Definition: ext/kintinuous/kfusion/include/kfusion/Options.hpp:195


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 Wed Mar 2 2022 00:37:24