ScanDirectoryParser.hpp
Go to the documentation of this file.
1 
28 #ifndef __DIRECTORY_PARSER_HPP__
29 #define __DIRECTORY_PARSER_HPP__
30 
31 #include <string>
32 #include <vector>
33 
34 #include <boost/filesystem.hpp>
35 #include <Eigen/Dense>
36 
37 #include "lvr2/io/Timestamp.hpp"
38 #include "lvr2/io/PointBuffer.hpp"
41 
42 namespace lvr2
43 {
44 
45 struct ScanInfo
46 {
47  string m_filename;
48  size_t m_numPoints;
50 };
51 
53 {
54 
55 public:
56  ScanDirectoryParser(const std::string& directory) noexcept;
57 
58  void setPointCloudPrefix(const std::string& prefix);
59  void setPointCloudExtension(const std::string& extension);
60  void setPosePrefix(const std::string& prefix);
61  void setPoseExtension(const std::string& extension);
62 
63  void setStart(int s);
64  void setEnd(int e);
65 
66  void parseDirectory();
67 
68  PointBufferPtr randomSubSample(const size_t& targetSize);
69  PointBufferPtr octreeSubSample(const double& voxelSize, const size_t& minPoints = 5);
70 
72 
73 private:
74 
75  using Path = boost::filesystem::path;
76 
77  size_t examinePLY(const std::string& filename);
78  size_t examineASCII(const std::string& filename);
79 
80  size_t m_numPoints;
81  std::string m_pointPrefix;
82  std::string m_posePrefix;
83  std::string m_poseExtension;
84  std::string m_pointExtension;
85  std::string m_directory;
86 
87  size_t m_start;
88  size_t m_end;
89 
90  std::vector<ScanInfo*> m_scans;
91 };
92 
93 } // namespace lvr2
94 
95 #endif
lvr2::ScanDirectoryParser::examinePLY
size_t examinePLY(const std::string &filename)
Definition: ScanDirectoryParser.cpp:75
lvr2::ScanDirectoryParser
Definition: ScanDirectoryParser.hpp:52
lvr2::ScanDirectoryParser::setPosePrefix
void setPosePrefix(const std::string &prefix)
Definition: ScanDirectoryParser.cpp:56
lvr2::ScanDirectoryParser::setEnd
void setEnd(int e)
Definition: ScanDirectoryParser.cpp:69
lvr2::ScanDirectoryParser::examineASCII
size_t examineASCII(const std::string &filename)
Definition: ScanDirectoryParser.cpp:80
lvr2::ScanInfo::m_numPoints
size_t m_numPoints
Definition: ScanDirectoryParser.hpp:48
lvr2::Transformd
Transform< double > Transformd
4x4 double precision transformation matrix
Definition: MatrixTypes.hpp:71
lvr2::PointBufferPtr
std::shared_ptr< PointBuffer > PointBufferPtr
Definition: PointBuffer.hpp:130
lvr2::ScanDirectoryParser::m_scans
std::vector< ScanInfo * > m_scans
Definition: ScanDirectoryParser.hpp:90
lvr2::ScanDirectoryParser::setPoseExtension
void setPoseExtension(const std::string &extension)
Definition: ScanDirectoryParser.cpp:60
lvr2::ScanDirectoryParser::octreeSubSample
PointBufferPtr octreeSubSample(const double &voxelSize, const size_t &minPoints=5)
Definition: ScanDirectoryParser.cpp:86
lvr2::ScanInfo
Definition: ScanDirectoryParser.hpp:45
lvr2::ScanInfo::m_pose
Transformd m_pose
Definition: ScanDirectoryParser.hpp:49
lvr2::ScanDirectoryParser::setPointCloudPrefix
void setPointCloudPrefix(const std::string &prefix)
Definition: ScanDirectoryParser.cpp:47
PointBuffer.hpp
scripts.normalize_multiple.filename
filename
Definition: normalize_multiple.py:60
MatrixTypes.hpp
lvr2::ScanDirectoryParser::Path
boost::filesystem::path Path
Definition: ScanDirectoryParser.hpp:75
lvr2::ScanDirectoryParser::m_posePrefix
std::string m_posePrefix
Definition: ScanDirectoryParser.hpp:82
lvr2::ScanDirectoryParser::m_start
size_t m_start
Definition: ScanDirectoryParser.hpp:87
lvr2::ScanDirectoryParser::setStart
void setStart(int s)
Definition: ScanDirectoryParser.cpp:65
lvr2::ScanDirectoryParser::m_pointPrefix
std::string m_pointPrefix
Definition: ScanDirectoryParser.hpp:81
lvr2
Definition: BaseBufferManipulators.hpp:39
Timestamp.hpp
lvr2::ScanDirectoryParser::m_end
size_t m_end
Definition: ScanDirectoryParser.hpp:88
lvr2::ScanDirectoryParser::ScanDirectoryParser
ScanDirectoryParser(const std::string &directory) noexcept
Definition: ScanDirectoryParser.cpp:24
lvr2::ScanDirectoryParser::m_directory
std::string m_directory
Definition: ScanDirectoryParser.hpp:85
lvr2::ScanDirectoryParser::m_pointExtension
std::string m_pointExtension
Definition: ScanDirectoryParser.hpp:84
lvr2::ScanDirectoryParser::randomSubSample
PointBufferPtr randomSubSample(const size_t &targetSize)
Definition: ScanDirectoryParser.cpp:122
lvr2::ScanDirectoryParser::parseDirectory
void parseDirectory()
Definition: ScanDirectoryParser.cpp:179
lvr2::ScanDirectoryParser::setPointCloudExtension
void setPointCloudExtension(const std::string &extension)
Definition: ScanDirectoryParser.cpp:51
lvr2::ScanDirectoryParser::~ScanDirectoryParser
~ScanDirectoryParser()
Definition: ScanDirectoryParser.cpp:15
lvr2::ScanDirectoryParser::m_numPoints
size_t m_numPoints
Definition: ScanDirectoryParser.hpp:80
lvr2::ScanInfo::m_filename
string m_filename
Definition: ScanDirectoryParser.hpp:47
lvr2::ScanDirectoryParser::m_poseExtension
std::string m_poseExtension
Definition: ScanDirectoryParser.hpp:83
TransformUtils.hpp


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 Wed Mar 2 2022 00:37:25