MeshStage.hpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided
13  * with the distribution.
14  * * Neither the name of Willow Garage, Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived
16  * from this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 /*
33  * MeshStage.hpp
34  *
35  * @date 13.11.2015
36  * @author Tristan Igelbrink (Tristan@Igelbrink.com)
37  */
38 
39 #ifndef MeshStage_HPP__
40 #define MeshStage_HPP__
41 
42 #include <list>
43 #include "AbstractStage.hpp"
44 #include "BlockingQueue.hpp"
45 #include <boost/any.hpp>
46 #include <lvr/reconstruction/FastReconstruction.hpp>
47 #include <lvr/reconstruction/TSDFGrid.hpp>
48 #include <lvr/reconstruction/PointsetSurface.hpp>
49 #include <lvr/reconstruction/FastKinFuBox.hpp>
50 #include <lvr/io/PointBuffer.hpp>
51 #include <lvr/io/DataStruct.hpp>
52 #include <lvr/geometry/HalfEdgeVertex.hpp>
53 #include <lvr/geometry/HalfEdgeKinFuMesh.hpp>
54 #include <lvr/geometry/BoundingBox.hpp>
55 #include <lvr/geometry/Matrix4.hpp>
56 
57 #include <kfusion/types.hpp>
58 #include <opencv2/flann/flann.hpp>
59 
60 
61 using namespace lvr;
62 using namespace std;
63 using namespace kfusion;
64 
65 typedef Vertex<float> fVertex;
66 typedef ColorVertex<float, unsigned char> cVertex;
67 typedef FastKinFuBox<ColorVertex<float, unsigned char>, lvr::Normal<float> > cFastBox;
68 typedef TsdfGrid<cVertex, cFastBox, kfusion::Point> TGrid;
69 typedef FastReconstruction<ColorVertex<float, unsigned char>, lvr::Normal<float>, cFastBox > cFastReconstruction;
70 typedef HalfEdgeKinFuMesh<cVertex, lvr::Normal<float> > HMesh;
71 typedef HMesh* MeshPtr;
72 
73 class MeshStage : public AbstractStage
74 {
75 public:
76 
77  // default constructor
78  MeshStage(double camera_target_distance, double voxel_size, Options* options);
79 
80  virtual void firstStep();
81  virtual void step();
82  virtual void lastStep();
83 
84 private:
85  void transformMeshBack(MeshPtr mesh);
86 
87  queue<MeshPtr> last_mesh_queue_;
89  double voxel_size_;
90  size_t mesh_count_, fusion_count_;
94 };
95 #endif // STAGE
FastKinFuBox< ColorVertex< float, unsigned char >, lvr::Normal< float > > cFastBox
Definition: GridStage.hpp:64
HalfEdgeKinFuMesh< cVertex, lvr::Normal< float > > HMesh
Definition: MeshStage.hpp:70
Eigen::Matrix4f Matrix4f
Eigen 4x4 matrix, single precision.
HalfEdgeMesh< Vec > mesh
const kaboom::Options * options
double camera_target_distance_
Definition: MeshStage.hpp:88
HalfEdgeKinFuMesh< cVertex, lvr::Normal< float > > HMesh
Definition: FusionStage.hpp:62
A class to parse the program options for the reconstruction executable.
lvr::Matrix4f global_correction_
Definition: MeshStage.hpp:93
Options * options_
Definition: MeshStage.hpp:91
ColorVertex< float, unsigned char > cVertex
Definition: MeshStage.hpp:66
bool slice_correction_
Definition: MeshStage.hpp:92
size_t mesh_count_
Definition: MeshStage.hpp:90
HMesh * MeshPtr
Definition: FusionStage.hpp:63
Vertex< float > fVertex
Definition: MeshStage.hpp:65
HMesh * MeshPtr
Definition: MeshStage.hpp:71
Utility.
Definition: capture.hpp:8
TsdfGrid< cVertex, cFastBox, kfusion::Point > TGrid
Definition: MeshStage.hpp:68
FastKinFuBox< ColorVertex< float, unsigned char >, lvr::Normal< float > > cFastBox
Definition: MeshStage.hpp:67
double voxel_size_
Definition: MeshStage.hpp:89
FastReconstruction< ColorVertex< float, unsigned char >, lvr::Normal< float >, cFastBox > cFastReconstruction
Definition: MeshStage.hpp:69
queue< MeshPtr > last_mesh_queue_
Definition: MeshStage.hpp:87


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