src/tools/lvr2_dmc_reconstruction/Options.cpp
Go to the documentation of this file.
1 /*
2 * OptionsDMC.cpp
3 *
4 * Created on: May 13, 2020
5 * Author: Benedikt Schumacher
6 */
7 
8 #include "Options.hpp"
10 
11 
12 using namespace boost::program_options;
14  Options::Options(int argc, char **argv) : BaseOption(argc, argv) {
15  m_descr.add_options()
16  ("help", "Produce help message")
17  ("inputFile",value<vector<string>>(), "Input file name. Supported formats are ASCII (.pts, .xyz) and .ply")
18  ("ml", value<int>(&m_maxLevel)->default_value(8), "Maximum allowed octree levels")
19  ("e", value<float>(&m_maxError)->default_value(2.8), "Maximum allowed error between points and surfaces")
20  ("kd", value<int>(&m_kd)->default_value(5), "Number of normals used for distance function evaluation")
21  ("ki", value<int>(&m_ki)->default_value(10), "Number of normals used in the normal interpolation process")
22  ("kn", value<int>(&m_kn)->default_value(10), "Size of k-neighborhood used for normal estimation")
23  ("pcm,p", value<string>(&m_pcm)->default_value("FLANN"), "Point cloud manager used for point handling and normal estimation. Choose from {STANN, PCL, NABO}.")
24  ("ransac", "Set this flag for RANSAC based normal estimation.")
25  ("scanPoseFile", value<string>()->default_value(""), "ASCII file containing scan positions that can be used to flip normals")
26  ("threads", value<int>(&m_numThreads)->default_value( lvr2::OpenMPConfig::getNumThreads() ), "Number of threads")
27  ;
28  setup();
29  }
30 
32  //TODO: Auto-generated destructor stub
33  }
34 
35  string Options::getInputFileName() const {
36  return (m_variables["inputFile"].as<vector<string>>())[0];
37  }
38 
39  int Options::getMaxLevel() const {
40  return (m_variables["ml"].as<int>());
41  }
42 
43  float Options::getMaxError() const {
44  return (m_variables["e"].as<float>());
45  }
46 
47  bool Options::printUsage() const {
48  if (m_variables.count("help"))
49  {
50  cout << endl;
51  cout << m_descr << endl;
52  return true;
53  }
54  else if (!m_variables.count("inputFile"))
55  {
56  cout << "Error: You must specify an input file." << endl;
57  cout << endl;
58  cout << m_descr << endl;
59  return true;
60  }
61  return false;
62  }
63 
64 
65  int Options::getKd() const {
66  return m_variables["kd"].as<int>();
67  }
68 
69  int Options::getKn() const {
70  return m_variables["kn"].as<int>();
71  }
72 
73  int Options::getKi() const {
74  return m_variables["ki"].as<int>();
75  }
76 
77  int Options::getNumThreads() const {
78  return m_variables["threads"].as<int>();
79  }
80 
81  string Options::getPCM() const {
82  return (m_variables["pcm"].as<string>());
83  }
84 
85  bool Options::useRansac() const
86  {
87  return (m_variables.count("ransac"));
88  }
89 
90  string Options::getScanPoseFile() const
91  {
92  return (m_variables["scanPoseFile"].as<string>());
93  }
94 }
95 
int m_ki
The number of neighbors for normal interpolation.
static int getNumThreads()
Returns the number of supported threads (or 1 if OpenMP is not supported)
Definition: lvropenmp.cpp:70
int m_kn
The number of neighbors for normal estimation.
virtual void setup()
Setup internal data structures.
Definition: BaseOption.cpp:84
int m_maxLevel
The maximum allows octree level.
options_description m_descr
The internally used option description.
Definition: BaseOption.hpp:107
float m_maxError
The max allowed error between points and surfaces in an octree cell.
int m_kd
The number of neighbors for distance function evaluation.
variables_map m_variables
The internally used variable map.
Definition: BaseOption.hpp:104
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