LargeScaleReconstruction.hpp
Go to the documentation of this file.
1 
28 #ifndef LAS_VEGAS_LARGESCALERECONSTRUCTION_HPP
29 #define LAS_VEGAS_LARGESCALERECONSTRUCTION_HPP
30 
31 #include "lvr2/types/ScanTypes.hpp"
36 
37 
38 namespace lvr2
39 {
40  struct LSROptions
41  {
42  //flag to trigger .ply output of big Mesh
43  bool bigMesh = true;
44 
45  // flag to trigger .ply output of chunks
46  bool debugChunks = false;
47 
48  // flag to trigger GPU usage
49  bool useGPU = false;
50 
51  // voxelsizes for reconstruction.
52  std::vector<float> voxelSizes{0.1};
53 
54  // voxelsize for the BigGrid.
55  float bgVoxelSize = 1;
56 
57  // scale factor.
58  float scale = 1;
59 
60  // Max. Number of Points in a leaf (used to devide pointcloud).
61  uint nodeSize = 1000000;
62 
63  // int flag to trigger partition-method (0 = kd-Tree; 1 = VGrid)
64  int partMethod = 1;
65 
66  //Number of normals used in the normal interpolation process.
67  int ki = 20;
68 
69  //Number of normals used for distance function evaluation.
70  int kd = 20;
71 
72  // Size of k-neighborhood used for normal estimation.
73  int kn = 20;
74 
75  //Set this flag for RANSAC based normal estimation.
76  bool useRansac = false;
77 
78  // FlipPoint for GPU normal computation
79  std::vector<float> flipPoint{10000000, 10000000, 10000000};
80 
81  // Do not extend grid. Can be used to avoid artifacts in dense data sets but. Disabling
82  // will possibly create additional holes in sparse data sets.
83  bool extrude = false;
84 
85  /*
86  * Definition from here on are for the combine-process of partial meshes
87  */
88 
89  // number for the removal of dangling artifacts.
91 
92  //Remove noise artifacts from contours. Same values are between 2 and 4.
93  int cleanContours = 0;
94 
95  //Maximum size for hole filling.
96  int fillHoles = 0;
97 
98  // Shift all triangle vertices of a cluster onto their shared plane.
99  bool optimizePlanes = false;
100 
101  // (Plane Normal Threshold) Normal threshold for plane optimization.
102  float planeNormalThreshold = 0.85;
103 
104  // Number of iterations for plane optimization.
106 
107  // Minimum value for plane optimization.
108  int minPlaneSize = 7;
109 
110  // Threshold for small region removal. If 0 nothing will be deleted.
112 
113  // Retesselate regions that are in a regression plane. Implies --optimizePlanes.
114  bool retesselate = false;
115 
116  // Threshold for fusing line segments while tesselating.
117  float lineFusionThreshold = 0.01;
118 
119  vector<float> getFlipPoint() const
120  {
121  std::vector<float> dest = flipPoint;
122  if(dest.size() != 3)
123  {
124  std::vector<float> dest = std::vector<float>();
125  dest.push_back(10000000);
126  dest.push_back(10000000);
127  dest.push_back(10000000);
128  }
129  return dest;
130  }
131  };
132 
133  template <typename BaseVecT>
135  {
136 
137 
138  public:
143 
144 
148  LargeScaleReconstruction(vector<float> voxelSizes, float bgVoxelSize, float scale,
149  uint nodeSize, int partMethod,int ki, int kd, int kn, bool useRansac, std::vector<float> flipPoint,
151  float getNormalThreshold, int planeIterations, int minPlaneSize, int smallRegionThreshold,
152  bool retesselate, float lineFusionThreshold, bool bigMesh, bool debugChunks, bool useGPU);
153 
159 
169  int mpiChunkAndReconstruct(ScanProjectEditMarkPtr project, BoundingBox<BaseVecT>& newChunksBB, std::shared_ptr<ChunkHashGrid> chunkManager);
170 
177  int mpiAndReconstruct(ScanProjectEditMarkPtr project);
178 
188  HalfEdgeMesh<BaseVecT> getPartialReconstruct(BoundingBox<BaseVecT> newChunksBB, std::shared_ptr<ChunkHashGrid> chunkHashGrid, float voxelSize);
189 
190 
191 
192 
193  private:
194 
203  void addTSDFChunkManager(int x, int y, int z,
205  shared_ptr<ChunkHashGrid> cm,
206  std::string layerName);
207 
208  //flag to trigger .ply output of big Mesh
209  bool m_bigMesh = true;
210 
211  // flag to trigger .ply output of chunks
212  bool m_debugChunks = false;
213 
214  // flag to trigger GPU usage
215  bool m_useGPU = false;
216 
217  // path to hdf5 path containing previously reconstructed scans (or no scans) only
218  string m_filePath;
219 
220  // voxelsize for reconstruction. Default: 10
221  vector <float> m_voxelSizes;
222 
223  // voxelsize for the BigGrid. Default: 10
225 
226  // scale factor. Default: 1
227  float m_scale;
228 
229  //ChunkSize, should be constant through all processes . Default: 20
230  float m_chunkSize;
231 
232  // Max. Number of Points in a leaf (used to devide pointcloud). Default: 1000000
234 
235  // int flag to trigger partition-method (0 = kd-Tree; 1 = VGrid)
237 
238  //Number of normals used in the normal interpolation process. Default: 10
239  int m_ki;
240 
241  //Number of normals used for distance function evaluation. Default: 5
242  int m_kd;
243 
244  // Size of k-neighborhood used for normal estimation. Default: 10
245  int m_kn;
246 
247  // flipPoint for GPU normal computation
248  std::vector<float> m_flipPoint;
249 
250  //Set this flag for RANSAC based normal estimation. Default: false
252 
253  // Do not extend grid. Can be used to avoid artifacts in dense data sets but. Disabling
254  // will possibly create additional holes in sparse data sets. Default: false
255  bool m_extrude;
256 
257  /*
258  * Definition from here on are for the combine-process of partial meshes
259  */
260 
261  // flag to trigger the removal of dangling artifacts. Default: 0
263 
264  //Remove noise artifacts from contours. Same values are between 2 and 4. Default: 0
266 
267  //Maximum size for hole filling. Default: 0
269 
270  // Shift all triangle vertices of a cluster onto their shared plane. Default: false
272 
273  // (Plane Normal Threshold) Normal threshold for plane optimization. Default: 0.85
275 
276  // Number of iterations for plane optimization. Default: 3
278 
279  // Minimum value for plane optimization. Default: 7
281 
282  // Threshold for small region removal. If 0 nothing will be deleted. Default: 0
284 
285  // Retesselate regions that are in a regression plane. Implies --optimizePlanes. Default: false
287 
288  // Threshold for fusing line segments while tesselating. Default: 0.01
290 
291 
292  };
293 } // namespace lvr2
294 
295 #include "lvr2/reconstruction/LargeScaleReconstruction.tcc"
296 
297 #endif // LAS_VEGAS_LARGESCALERECONSTRUCTION_HPP
const kaboom::Options * options
std::vector< float > flipPoint
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
vector< float > getFlipPoint() const
Half-edge data structure implementing the BaseMesh interface.
std::shared_ptr< ScanProjectEditMark > ScanProjectEditMarkPtr
Definition: ScanTypes.hpp:357
unsigned int uint
Definition: Model.hpp:46
A volume representation used by the standard Marching Cubes implementation.
Definition: FastBox.hpp:65
std::vector< float > voxelSizes


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