LargeScaleOptions.hpp
Go to the documentation of this file.
1 
28 /*
29  * LargeScaleOptions.hpp
30  *
31  * Author: Isaak Mitschke
32  */
33 
34 #ifndef LARGESCALEOPTIONS_H_
35 #define LARGESCALEOPTIONS_H_
36 
38 
39 #include <boost/program_options.hpp>
40 #include <float.h>
41 #include <iostream>
42 #include <string>
43 #include <vector>
44 
45 using std::cout;
46 using std::endl;
47 using std::ostream;
48 using std::string;
49 using std::vector;
50 
51 namespace LargeScaleOptions
52 {
53 
58 class Options : public lvr2::BaseOption
59 {
60  public:
65  Options(int argc, char** argv);
66  virtual ~Options();
67 
71  bool getBigMesh() const;
72 
76  bool getDebugChunks() const;
77 
81  bool useGPU() const;
82 
86  vector<float> getVoxelSizes() const;
87 
91  float getVoxelsize() const;
92 
96  float getBGVoxelsize() const;
97 
101  float getScaling() const;
102 
106  // TODO data types don't match!!
107  int getChunkSize() const;
108 
112  unsigned int getNodeSize() const;
113 
117  int getPartMethod() const;
118 
123  int getKi() const;
124 
129  int getKd() const;
130 
135  int getKn() const;
136 
140  bool useRansac() const;
141 
145  vector<float> getFlippoint() const;
146 
150  bool extrude() const;
151 
152  /*
153  * Definition from here on are for the combine-process of partial meshes
154  */
155 
160  int getDanglingArtifacts() const;
161 
165  int getCleanContourIterations() const;
166 
170  int getFillHoles() const;
171 
175  bool optimizePlanes() const;
176 
180  float getNormalThreshold() const;
184  int getPlaneIterations() const;
185 
190  int getSmallRegionThreshold() const;
191 
195  bool retesselate() const;
196 
200  float getLineFusionThreshold() const;
201 
202  /*
203  * Definition from here on are not used (anymore?)
204  */
205 
209  int getNumThreads() const;
210 
214  bool printUsage() const;
215 
219  bool filenameSet() const;
220 
226  bool saveFaceNormals() const;
227 
231  bool colorRegions() const;
232 
237  bool saveNormals() const;
238 
242  bool saveGrid() const;
243 
248  bool saveOriginalData() const;
249 
250 
255  bool savePointNormals() const;
256 
261  bool recalcNormals() const;
262 
266  bool doTextureAnalysis() const;
267 
272  bool generateTextures() const;
273 
277  bool clusterPlanes() const;
278 
282  bool writeClassificationResult() const;
283 
287  std::vector<string> getInputFileName() const;
288 
292  string getClassifier() const;
293 
297  string getScanPoseFile() const;
298 
304  int getIntersections() const;
305 
309  string getPCM() const;
310 
314  string getDecomposition() const;
315 
319  int getMinPlaneSize() const;
320 
324  int getDepth() const;
325 
329  float getTexelSize() const;
330 
334  float getSharpFeatureThreshold() const;
335 
339  float getSharpCornerThreshold() const;
340 
344  int getNumEdgeCollapses() const;
345 
346  bool onlyNormals() const;
347 
351  string getEdgeCollapseMethod() const;
352 
353  unsigned int getNumStatsColors() const;
354 
355  unsigned int getNumCCVColors() const;
356 
357  unsigned int getCoherenceThreshold() const;
358 
359  float getColorThreshold() const;
360 
361  float getStatsThreshold() const;
362 
363  float getFeatureThreshold() const;
364 
365  bool getUseCrossCorr() const;
366 
367  float getPatternThreshold() const;
368 
369  float* getStatsCoeffs() const;
370 
371  string getTexturePack() const;
372 
373  int getMinimumTransformationVotes() const;
374  unsigned int getBufferSize() const;
375 
376  bool interpolateBoxes() const;
377 
378 
379  string getOutputFolderPath() const;
380 
381  bool getUseNormals() const;
382 
383  size_t getVolumenSize() const;
384 
385  size_t getLineReaderBuffer() const;
386 
387  private:
389  bool m_bigMesh;
390 
393 
395  vector<float> m_voxelSizes;
396 
398  float m_voxelsize;
399 
402 
403  float m_scaling;
404 
407 
410 
412  int m_ki;
413 
415  int m_kd;
416 
418  int m_kn;
419 
421  vector<float> m_flippoint;
422 
424  bool m_extrude;
425 
428 
431 
434 
437 
440 
443 
446 
449 
452 
453 
454  /*
455  * Definition from here on are not used (anymore?)
456  */
457 
460 
463 
466 
469 
472 
475 
477  string m_pcm;
478 
480  int m_depth;
481 
483  float m_texelSize;
484 
486  float m_sft;
487 
489  float m_sct;
490 
492  string m_classifier;
493 
495  string m_ecm;
496 
499 
501 
504 
507 
509  unsigned int m_numStatsColors;
510 
512  unsigned int m_numCCVColors;
513 
515  unsigned int m_coherenceThreshold;
516 
519 
522 
525 
528 
531 
534 
535  unsigned int m_bufferSize;
536 
537  unsigned int m_octreeNodeSize;
538 
540 
542 
544 
546 
548 
549 };
550 
552 inline ostream& operator<<(ostream& os, const Options& o)
553 {
554  o.printTransformation(os);
555 
556  if (o.getIntersections() > 0)
557  {
558  cout << "##### Intersections \t\t: " << o.getIntersections() << endl;
559  }
560  else
561  {
562  cout << "##### Voxelsize \t\t: " << o.getVoxelsize() << endl;
563  }
564  cout << "##### Number of threads \t: " << o.getNumThreads() << endl;
565  cout << "##### Point cloud manager \t: " << o.getPCM() << endl;
566  if (o.useRansac())
567  {
568  cout << "##### Use RANSAC\t\t: YES" << endl;
569  }
570  else
571  {
572  cout << "##### Use RANSAC\t\t: NO" << endl;
573  }
574 
575  cout << "##### Voxel decomposition \t: " << o.getDecomposition() << endl;
576  cout << "##### Classifier\t\t: " << o.getClassifier() << endl;
578  {
579  cout << "##### Dump classification\t: YES" << endl;
580  }
581  else
582  {
583  cout << "##### Dump classification\t: NO" << endl;
584  }
585  cout << "##### k_i \t\t\t: " << o.getKi() << endl;
586  cout << "##### k_d \t\t\t: " << o.getKd() << endl;
587  cout << "##### k_n \t\t\t: " << o.getKn() << endl;
588  if (o.getDecomposition() == "SF")
589  {
590  cout << "##### Sharp feature threshold \t: " << o.getSharpFeatureThreshold() << endl;
591  cout << "##### Sharp corner threshold \t: " << o.getSharpCornerThreshold() << endl;
592  }
593  if (o.retesselate())
594  {
595  cout << "##### Retesselate \t\t: YES" << endl;
596  cout << "##### Line fusion threshold \t: " << o.getLineFusionThreshold() << endl;
597  }
598  if (o.saveFaceNormals())
599  {
600  cout << "##### Write Face Normals \t: YES" << endl;
601  }
602 
603  if (o.getFillHoles())
604  {
605  cout << "##### Fill holes \t\t: " << o.getFillHoles() << endl;
606  }
607  else
608  {
609  cout << "##### Fill holes \t\t: NO" << endl;
610  }
611 
612  if (o.getDanglingArtifacts())
613  {
614  cout << "##### Remove DAs \t\t: " << o.getDanglingArtifacts() << endl;
615  }
616  else
617  {
618  cout << "##### Remove DAs \t\t: NO" << endl;
619  }
620 
621  if (o.optimizePlanes())
622  {
623  cout << "##### Optimize Planes \t\t: YES" << endl;
624  cout << "##### Plane iterations\t\t: " << o.getPlaneIterations() << endl;
625  cout << "##### Normal threshold \t\t: " << o.getNormalThreshold() << endl;
626  cout << "##### Region threshold\t\t: " << o.getSmallRegionThreshold() << endl;
627  }
628  if (o.saveNormals())
629  {
630  cout << "##### Save normals \t\t: YES" << endl;
631  }
632  if (o.saveOriginalData())
633  {
634  cout << "##### Save input data \t\t: YES" << endl;
635  }
636 
637  if (o.recalcNormals())
638  {
639  cout << "##### Recalc normals \t\t: YES" << endl;
640  }
641  if (o.savePointNormals())
642  {
643  cout << "##### Save points normals \t: YES" << endl;
644  }
645  if (o.generateTextures())
646  {
647  cout << "##### Generate Textures \t: YES" << endl;
648  cout << "##### Texel size \t\t: " << o.getTexelSize() << endl;
649  if (o.doTextureAnalysis())
650  {
651  cout << "##### Texture Analysis \t: OFF" << endl;
652  }
653  else
654  {
655  cout << "##### Texture Analysis \t\t: OFF" << endl;
656  }
657  }
658  if (o.getDepth())
659  {
660  cout << "##### Recursion depth \t\t: " << o.getDepth() << endl;
661  }
662  if (o.getNumEdgeCollapses())
663  {
664  cout << "##### Edge collapse method \t\t: " << o.getEdgeCollapseMethod() << endl;
665  cout << "##### Number of edge collapses\t: " << o.getNumEdgeCollapses() << endl;
666  }
667 
668  if (o.getNodeSize())
669  {
670  cout << "##### Leaf Size \t\t: " << o.getNodeSize() << endl;
671  }
672 
673  cout << "##### Interpolating Boxes \t: " << o.interpolateBoxes() << endl;
674 
675  if (o.getBufferSize())
676  {
677  cout << "##### Buffer Size \t\t: " << o.getBufferSize() << endl;
678  }
679  cout << "##### Volumen Size \t\t: " << o.getVolumenSize() << endl;
680  return os;
681 }
682 
683 } // namespace LargeScaleOptions
684 
685 #endif /* LARGESCALEOPTIONS_H_ */
float getLineFusionThreshold() const
Returns the fusion threshold for tesselation.
int m_ki
The number of neighbors for normal interpolation.
float m_voxelsize
The set voxelsize.
bool generateTextures() const
If true, textures will be generated during finalization of mesh.
string getScanPoseFile() const
Returns the name of the given file with scan poses used for normal flipping.
string m_classifier
Name of the classifier object to color the mesh.
float getSharpFeatureThreshold() const
Returns the sharp feature threshold when using sharp feature decomposition.
bool optimizePlanes() const
Returns true if cluster optimization is enabled.
int m_planeIterations
Number of iterations for plane optimzation.
int getNumEdgeCollapses() const
Number of edge collapses.
string m_faceNormalFile
The putput file name for face normals.
int getNumThreads() const
Returns the number of used threads.
int getDanglingArtifacts() const
Returns the number of dangling artifacts to remove from a created mesh.
float m_featuresThreshold
Threshold for texture matching based on features.
ostream & operator<<(ostream &os, const Options &o)
Overlaoeded outpur operator.
A class to parse the program options for the reconstruction executable.
bool m_generateTextures
Whether or not the mesh should be retesselated while being finalized.
int m_chunkSize
gridsize for virtual grid
float m_sft
Sharp feature threshold when using sharp feature decomposition.
bool extrude() const
Whether to extend the grid. Enabled by default.
bool saveFaceNormals() const
Returns true if the face normals of the reconstructed mesh should be saved to an extra file ("face_no...
int getPartMethod() const
Retuns flag for partition-method (0 = kd-Tree; 1 = VGrid)
int m_depth
Maximum recursion depth for region growing.
int m_minPlaneSize
Threshold for plane optimization.
unsigned int getBufferSize() const
bool useGPU() const
Returns if the GPU shuold be used for the normal estimation.
bool m_writeClassificationResult
Whether or not the classifier shall dump meta data to a file &#39;clusters.clu&#39;.
void printTransformation(std::ostream &out) const
Prints transformation information to the given output stream.
Definition: BaseOption.cpp:60
int getKn() const
Returns the number of neighbors used for initial normal estimation.
int m_removeDanglingArtifacts
Number of dangling artifacts to remove.
float getVoxelsize() const
Returns the first given voxelsize.
unsigned int m_coherenceThreshold
Coherence threshold for texture matching based on color information.
bool printUsage() const
Prints a usage message to stdout.
float m_lineFusionThreshold
Threshold for line fusing when tesselating.
bool doTextureAnalysis() const
True if texture analysis is enabled.
int m_kn
The number of neighbors for normal estimation.
float m_sct
Sharp corner threshold when using sharp feature decomposition.
float m_planeNormalThreshold
Threshold for plane optimization.
int getKi() const
Returns the number of neighbors for normal interpolation.
bool saveNormals() const
Returns true if the interpolated normals should be saved in the putput file.
int m_partMethod
sets partition method to kd-tree or virtual grid
bool getDebugChunks() const
Returns if the mesh of every chunk additionally should be written as a .ply.
float getNormalThreshold() const
Returns the normal threshold for plane optimization.
float getScaling() const
Returns the scaling factor.
float m_patternThreshold
Threshold for pattern extraction from textures.
int getDepth() const
Returns the maximum recursion depth for region growing.
unsigned int getNumStatsColors() const
int m_minimumTransformationVotes
Minimum number of vote to consider a texture transformation as "correct".
int m_smallRegionThreshold
Threshold for small regions.
float m_colorThreshold
Threshold for texture matching based on colors.
int getPlaneIterations() const
Returns to number plane optimization iterations.
bool filenameSet() const
Returns true if an output filen name was set.
std::vector< string > getInputFileName() const
Returns the output file name.
int getMinPlaneSize() const
Minimum value for plane optimzation.
bool savePointNormals() const
Indicates whether to save the used points together with the interpolated normals. ...
int m_cleanContourIterations
number of cleanContour iterations
vector< float > getFlippoint() const
Returns the flipPoint for GPU normal computation.
unsigned int getCoherenceThreshold() const
int m_numThreads
The number of used threads.
string m_statsCoeffs
Coefficents file for texture matching based on statistics.
bool colorRegions() const
Returns true of region coloring is enabled.
string m_pcm
The used point cloud manager.
float m_voxelsizeBG
The set voxelsize for BigGrid.
int m_kd
The number of neighbors for distance function evaluation.
int getFillHoles() const
Returns the region threshold for hole filling.
float m_statsThreshold
Threshold for texture matching based on statistics.
string getDecomposition() const
Returns the name of the used point cloud handler.
vector< float > m_voxelSizes
The set voxelsizes.
unsigned int m_numStatsColors
Number of colors for texture statistics.
bool saveGrid() const
Returns true if the Marching Cubes grid should be save.
int getSmallRegionThreshold() const
Returns the threshold for the size of small region deletion after plane optimization.
string m_ecm
Edge collapse method.
bool recalcNormals() const
If true, normals should be calculated even if they are already given in the input file...
float getSharpCornerThreshold() const
Returns the sharp corner threshold when using sharp feature decomposition.
bool clusterPlanes() const
True if region clustering without plane optimization is required.
int getCleanContourIterations() const
Number of iterations for contour cleanup.
bool m_useCrossCorr
Whether to use texture matching based on cross correlation.
int m_numberOfDefaults
The number of used default values.
bool m_debugChunks
flag to generate debug meshes for every chunk as a .ply
int m_intersections
The number of intersections used for reconstruction.
int m_numEdgeCollapses
Number of edge collapses.
string getEdgeCollapseMethod() const
Edge collapse method.
bool writeClassificationResult() const
True if region clustering without plane optimization is required.
unsigned int getNodeSize() const
Only used in kd-tree (partMethod=0). Returns the maximum number of points in a leaf.
bool useRansac() const
If true, RANSAC based normal estimation is used.
vector< float > m_flippoint
flipPoint for GPU normal computation
bool retesselate() const
Return whether the mesh should be retesselated or not.
int getKd() const
Returns the number of neighbors used for distance function evaluation.
string getClassifier() const
Returns the name of the classifier used to color the mesh.
bool saveOriginalData() const
Returns true if the original points should be stored together with the reconstruction.
float getTexelSize() const
Returns the texel size for texture resolution.
bool m_bigMesh
flag to generate a .ply file for the reconstructed mesh
int getChunkSize() const
Returns the chunksize.
int getIntersections() const
Returns the number of intersections. If the return value is positive it will be used for reconstructi...
int m_fillHoles
Threshold for hole filling.
string getPCM() const
Returns the name of the used point cloud handler.
bool m_retesselate
Whether or not the mesh should be retesselated while being finalized.
float getBGVoxelsize() const
Returns the given voxelsize for bigGrid.
unsigned int getNumCCVColors() const
unsigned int m_numCCVColors
Number of colors for texture matching based on color information.
vector< float > getVoxelSizes() const
Returns all voxelsizes as a vector.
string m_texturePack
Path to texture pack.
Options(int argc, char **argv)
Ctor. Parses the command parameters given to the main function of the program.
bool getBigMesh() const
Returns if the new chunks should be written as a .ply-mesh.
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:06