src/tools/lvr2_largescale_reconstruct/Options.hpp
Go to the documentation of this file.
1 
28 /*
29  * Options.h
30  *
31  * Created on: Nov 21, 2010
32  * Author: Thomas Wiemann
33  */
34 
35 #ifndef OPTIONS_H_
36 #define OPTIONS_H_
37 
39 
40 #include <boost/program_options.hpp>
41 #include <float.h>
42 #include <iostream>
43 #include <string>
44 #include <vector>
45 
46 using std::cout;
47 using std::endl;
48 using std::ostream;
49 using std::string;
50 using std::vector;
51 
52 namespace reconstruct
53 {
54 
59 class Options : public lvr2::BaseOption
60 {
61  public:
66  Options(int argc, char** argv);
67  virtual ~Options();
68 
72  float getVoxelsize() const;
73 
77  int getNumThreads() const;
78 
82  bool printUsage() const;
83 
87  bool filenameSet() const;
88 
94  bool saveFaceNormals() const;
95 
99  bool colorRegions() const;
100 
105  bool saveNormals() const;
106 
110  bool saveGrid() const;
111 
116  bool saveOriginalData() const;
117 
121  bool optimizePlanes() const;
122 
127  bool savePointNormals() const;
128 
133  bool recalcNormals() const;
134 
138  bool useRansac() const;
139 
143  bool doTextureAnalysis() const;
144 
149  bool generateTextures() const;
150 
155  int getKi() const;
156 
161  int getKn() const;
162 
167  int getKd() const;
168 
172  bool retesselate() const;
173 
177  bool clusterPlanes() const;
178 
182  bool writeClassificationResult() const;
183 
187  string getInputFileName() const;
188 
192  string getOutputFileName() const;
193 
197  vector<string> getOutputFileNames() const;
198 
202  string getClassifier() const;
203 
207  string getScanPoseFile() const;
208 
214  int getIntersections() const;
215 
219  int getPlaneIterations() const;
220 
224  string getPCM() const;
225 
229  string getDecomposition() const;
230 
234  float getNormalThreshold() const;
235 
240  int getSmallRegionThreshold() const;
241 
245  int getMinPlaneSize() const;
246 
250  int getCleanContourIterations() const;
251 
256  int getDanglingArtifacts() const;
257 
261  int getFillHoles() const;
262 
266  float getTexelSize() const;
267 
271  float getSharpFeatureThreshold() const;
272 
276  float getSharpCornerThreshold() const;
277 
281  float getLineFusionThreshold() const;
282 
286  bool extrude() const;
287 
291  float getEdgeCollapseReductionRatio() const;
292 
293  unsigned int getNumStatsColors() const;
294 
295  unsigned int getNumCCVColors() const;
296 
297  unsigned int getCoherenceThreshold() const;
298 
299  float getColorThreshold() const;
300 
301  float getStatsThreshold() const;
302 
303  float getFeatureThreshold() const;
304 
305  bool getUseCrossCorr() const;
306 
307  float getPatternThreshold() const;
308 
309  float* getStatsCoeffs() const;
310 
311  string getTexturePack() const;
312 
313  int getMinimumTransformationVotes() const;
314 
315  int getTexMinClusterSize() const;
316 
317  int getTexMaxClusterSize() const;
318 
319  bool vertexColorsFromPointcloud() const;
320 
321  bool useGPU() const;
322 
323  vector<float> getFlippoint() const;
324 
325  bool texturesFromImages() const;
326 
327  string getProjectDir() const;
328 
329  private:
331  float m_voxelsize;
332 
335 
338 
341 
343  int m_kd;
344 
346  int m_kn;
347 
349  int m_ki;
350 
353 
356 
359 
362 
364  string m_pcm;
365 
368 
371 
374 
376  int m_rda;
377 
380 
383 
385 
387  float m_texelSize;
388 
391 
393  float m_sft;
394 
396  float m_sct;
397 
399  string m_classifier;
400 
403 
406 
409 
411  unsigned int m_numStatsColors;
412 
414  unsigned int m_numCCVColors;
415 
417  unsigned int m_coherenceThreshold;
418 
421 
424 
427 
430 
433 
436 
439 
441 
444 
445  // Flippoint for gpu normal calculation
446  vector<float> m_flippoint;
447 };
448 
450 inline ostream& operator<<(ostream& os, const Options& o)
451 {
452  o.printTransformation(os);
453 
454  if (o.getIntersections() > 0)
455  {
456  cout << "##### Intersections \t\t: " << o.getIntersections() << endl;
457  }
458  else
459  {
460  cout << "##### Voxelsize \t\t: " << o.getVoxelsize() << endl;
461  }
462  cout << "##### Number of threads \t: " << o.getNumThreads() << endl;
463  cout << "##### Point cloud manager \t: " << o.getPCM() << endl;
464  if (o.useRansac())
465  {
466  cout << "##### Use RANSAC\t\t: YES" << endl;
467  }
468  else
469  {
470  cout << "##### Use RANSAC\t\t: NO" << endl;
471  }
472 
473  cout << "##### Voxel decomposition: \t: " << o.getDecomposition() << endl;
474  cout << "##### Classifier:\t\t: " << o.getClassifier() << endl;
476  {
477  cout << "##### Dump classification\t: YES" << endl;
478  }
479  else
480  {
481  cout << "##### Dump classification\t: NO" << endl;
482  }
483  cout << "##### k_n \t\t\t: " << o.getKn() << endl;
484  cout << "##### k_i \t\t\t: " << o.getKi() << endl;
485  cout << "##### k_d \t\t\t: " << o.getKd() << endl;
486  if (o.getDecomposition() == "SF")
487  {
488  cout << "##### Sharp feature threshold \t: " << o.getSharpFeatureThreshold() << endl;
489  cout << "##### Sharp corner threshold \t: " << o.getSharpCornerThreshold() << endl;
490  }
491  if (o.retesselate())
492  {
493  cout << "##### Retesselate \t\t: YES" << endl;
494  cout << "##### Line fusion threshold \t: " << o.getLineFusionThreshold() << endl;
495  }
496  if (o.saveFaceNormals())
497  {
498  cout << "##### Write Face Normals \t: YES" << endl;
499  }
500 
501  if (o.getFillHoles())
502  {
503  cout << "##### Fill holes \t\t: " << o.getFillHoles() << endl;
504  }
505  else
506  {
507  cout << "##### Fill holes \t\t: NO" << endl;
508  }
509 
510  if (o.getDanglingArtifacts())
511  {
512  cout << "##### Remove DAs \t\t: " << o.getDanglingArtifacts() << endl;
513  }
514  else
515  {
516  cout << "##### Remove DAs \t\t: NO" << endl;
517  }
518 
519  if (o.optimizePlanes())
520  {
521  cout << "##### Optimize Planes \t\t: YES" << endl;
522  cout << "##### Plane iterations\t\t: " << o.getPlaneIterations() << endl;
523  cout << "##### Normal threshold \t\t: " << o.getNormalThreshold() << endl;
524  cout << "##### Region threshold\t\t: " << o.getSmallRegionThreshold() << endl;
525  cout << "##### Region min size\t\t: " << o.getMinPlaneSize() << endl;
526  }
527  if (o.saveNormals())
528  {
529  cout << "##### Save normals \t\t: YES" << endl;
530  }
531  if (o.saveOriginalData())
532  {
533  cout << "##### Save input data \t\t: YES" << endl;
534  }
535 
536  if (o.recalcNormals())
537  {
538  cout << "##### Recalc normals \t\t: YES" << endl;
539  }
540  if (o.savePointNormals())
541  {
542  cout << "##### Save points normals \t: YES" << endl;
543  }
545  {
546  cout << "##### Vertex colors: \t\t: YES" << endl;
547  }
548  if (o.generateTextures())
549  {
550  cout << "##### Generate Textures \t: YES" << endl;
551  cout << "##### Texel size \t\t: " << o.getTexelSize() << endl;
552  cout << "##### Texture Min#Cluster \t: " << o.getTexMinClusterSize() << endl;
553  cout << "##### Texture Max#Cluster \t: " << o.getTexMaxClusterSize() << endl;
554 
555  if (o.doTextureAnalysis())
556  {
557  cout << "##### Texture Analysis \t: ON" << endl;
558  }
559  else
560  {
561  cout << "##### Texture Analysis \t\t: OFF" << endl;
562  }
563  }
564  if (o.getEdgeCollapseReductionRatio() > 0.0)
565  {
566  cout << "##### Edge collapse reduction ratio\t: " << o.getEdgeCollapseReductionRatio()
567  << endl;
568  }
569 
570  if (o.useGPU())
571  {
572  cout << "##### GPU normal estimation \t: ON" << endl;
573  std::vector<float> flipPoint = o.getFlippoint();
574  cout << "##### Flippoint \t\t: (" << flipPoint[0] << ", " << flipPoint[1] << ", "
575  << flipPoint[2] << ")" << endl;
576  }
577  else
578  {
579  cout << "##### GPU normal estimation \t: OFF" << endl;
580  }
581 
582  return os;
583 }
584 
585 } // namespace reconstruct
586 
587 #endif /* OPTIONS_H_ */
bool m_useCrossCorr
Whether to use texture matching based on cross correlation.
bool printUsage() const
Prints a usage message to stdout.
int m_numberOfDefaults
The number of used default values.
float m_edgeCollapseReductionRatio
Reduction ratio for mesh reduction via edge collapse.
bool colorRegions() const
Returns true of region coloring is enabled.
int m_intersections
The number of intersections used for reconstruction.
string getClassifier() const
Returns the name of the classifier used to color the mesh.
int getPlaneIterations() const
Returns to number plane optimization iterations.
float m_featuresThreshold
Threshold for texture matching based on features.
bool saveFaceNormals() const
Returns true if the face normals of the reconstructed mesh should be saved to an extra file ("face_no...
bool saveGrid() const
Returns true if the Marching Cubes grid should be save.
int getDanglingArtifacts() const
Returns the number of dangling artifacts to remove from a created mesh.
bool recalcNormals() const
If true, normals should be calculated even if they are already given in the input file...
int getKd() const
Returns the number of neighbors used for distance function evaluation.
int m_texMinClusterSize
Minimum number of textures of a cluster needed for generating textures.
bool saveNormals() const
Returns true if the interpolated normals should be saved in the putput file.
int m_kn
The number of neighbors for normal estimation.
float getSharpFeatureThreshold() const
Returns the sharp feature threshold when using sharp feature decomposition.
bool filenameSet() const
Returns true if an output filen name was set.
int m_ki
The number of neighbors for normal interpolation.
float m_sft
Sharp feature threshold when using sharp feature decomposition.
void printTransformation(std::ostream &out) const
Prints transformation information to the given output stream.
Definition: BaseOption.cpp:60
vector< string > getOutputFileNames() const
Returns the output file names.
bool retesselate() const
Return whether the mesh should be retesselated or not.
int getCleanContourIterations() const
Number of iterations for contour cleanup.
float m_colorThreshold
Threshold for texture matching based on colors.
float getTexelSize() const
Returns the texel size for texture resolution.
int m_planeIterations
Number of iterations for plane optimzation.
int getKn() const
Returns the number of neighbors used for initial normal estimation.
float m_sct
Sharp corner threshold when using sharp feature decomposition.
int getKi() const
Returns the number of neighbors for normal interpolation.
bool extrude() const
Whether to extend the grid. Enable by default.
unsigned int m_numCCVColors
Number of colors for texture matching based on color information.
ostream & operator<<(ostream &os, const Options &o)
Overlaoeded outpur operator.
int getNumThreads() const
Returns the number of used threads.
int getSmallRegionThreshold() const
Returns the threshold for the size of small region deletion after plane optimization.
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
float getVoxelsize() const
Returns the given voxelsize.
string getDecomposition() const
Returns the name of the used point cloud handler.
unsigned int m_coherenceThreshold
Coherence threshold for texture matching based on color information.
float getSharpCornerThreshold() const
Returns the sharp corner threshold when using sharp feature decomposition.
bool m_retesselate
Whether or not the mesh should be retesselated while being finalized.
int getMinPlaneSize() const
Minimum value for plane optimzation.
int m_minPlaneSize
Threshold for plane optimization.
float getNormalThreshold() const
Returns the normal threshold for plane optimization.
string m_statsCoeffs
Coefficents file for texture matching based on statistics.
bool saveOriginalData() const
Returns true if the original points should be stored together with the reconstruction.
int getFillHoles() const
Returns the region threshold for hole filling.
unsigned int m_numStatsColors
Number of colors for texture statistics.
string m_faceNormalFile
The putput file name for face normals.
string m_classifier
Name of the classifier object to color the mesh.
int m_smallRegionThreshold
Threshold for small ragions.
string getScanPoseFile() const
Returns the name of the given file with scan poses used for normal flipping.
string getInputFileName() const
Returns the input file name.
bool writeClassificationResult() const
True if region clustering without plane optimization is required.
float getEdgeCollapseReductionRatio() const
Reduction ratio for mesh reduction via edge collapse.
float m_patternThreshold
Threshold for pattern extraction from textures.
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
int getIntersections() const
Returns the number of intersections. If the return value is positive it will be used for reconstructi...
bool m_writeClassificationResult
Whether or not the classifier shall dump meta data to a file &#39;clusters.clu&#39;.
bool generateTextures() const
If true, textures will be generated during finalization of mesh.
float m_planeNormalThreshold
Threshold for plane optimization.
bool doTextureAnalysis() const
True if texture analysis is enabled.
A class to parse the program options for the reconstruction executable.
bool m_vertexColorsFromPointcloud
Use pointcloud colors to paint vertices.
bool savePointNormals() const
Indicates whether to save the used points together with the interpolated normals. ...
int m_minimumTransformationVotes
Minimum number of vote to consider a texture transformation as "correct".
bool useRansac() const
If true, RANSAC based normal estimation is used.
bool optimizePlanes() const
Returns true if cluster optimization is enabled.
int m_kd
The number of neighbors for distance function evaluation.
bool clusterPlanes() const
True if region clustering without plane optimization is required.
string m_pcm
The used point cloud manager.
float getLineFusionThreshold() const
Returns the fusion threshold for tesselation.
int m_rda
Number of dangling artifacts to remove.
bool m_generateTextures
Whether or not the mesh should be retesselated while being finalized.
float m_statsThreshold
Threshold for texture matching based on statistics.
string getPCM() const
Returns the name of the used point cloud handler.
string getOutputFileName() const
Returns the output file name.
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