OctreeReduction.hpp
Go to the documentation of this file.
1 #ifndef __OCTREE_REDUCTION__
2 #define __OCTREE_REDUCTION__
3 
40 #include "lvr2/io/PointBuffer.hpp"
41 #include "lvr2/io/Timestamp.hpp"
42 
43 #include <vector>
44 
45 namespace lvr2
46 {
47 
49 {
50 public:
51  OctreeReduction(PointBufferPtr& pointBuffer, const double& voxelSize, const size_t& minPointsPerVoxel);
52  OctreeReduction(Vector3f* points, const size_t& n, const double& voxelSize, const size_t& minPointsPerVoxel);
53 
55  void getReducedPoints(Vector3f& points, size_t& n);
56 
57  ~OctreeReduction() { delete[] m_flags;}
58 
59 private:
60  template<typename T>
61  void createOctree(T* points, const int& n, bool* flagged, const T& min, const T& max, const int& level);
62 
63  template<typename T>
64  size_t splitPoints(T* points, const size_t& n, const int axis, const double& splitValue);
65 
66  template<typename T>
67  void createOctree(lvr2::PointBufferPtr& points, size_t s, size_t n, bool* flagged, const lvr2::Vector3<T>& min, const lvr2::Vector3<T>& max, const int& level);
68 
69  template<typename T>
70  size_t splitPoints(lvr2::PointBufferPtr& points, size_t s, size_t n, const int axis, const double& splitValue);
71 
72  template<typename T>
73  void swapAllChannelsOfType(lvr2::PointBufferPtr& points, const size_t& l, const size_t& r);
74 
75  template<typename T>
76  void swapInChannel(lvr2::Channel<T>& ch, const size_t& l, const size_t& r);
77 
78  double m_voxelSize;
80  size_t m_numPoints;
81  bool* m_flags;
82 
85 };
86 
87 } // namespace lvr2
88 
89 #include "lvr2/registration/OctreeReduction.tcc"
90 
91 #endif
PointBufferPtr getReducedPoints()
OctreeReduction(PointBufferPtr &pointBuffer, const double &voxelSize, const size_t &minPointsPerVoxel)
std::shared_ptr< PointBuffer > PointBufferPtr
Eigen::Vector3f Vector3f
Eigen 3D vector, single precision.
Eigen::Matrix< T, 3, 1 > Vector3
Eigen 3D vector.
void swapAllChannelsOfType(lvr2::PointBufferPtr &points, const size_t &l, const size_t &r)
PointBufferPtr m_pointBuffer
size_t splitPoints(T *points, const size_t &n, const int axis, const double &splitValue)
void swapInChannel(lvr2::Channel< T > &ch, const size_t &l, const size_t &r)
void createOctree(T *points, const int &n, bool *flagged, const T &min, const T &max, const int &level)


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