ScanIOUtils.hpp
Go to the documentation of this file.
1 #ifndef __SCANIOUTILS_HPP__
2 #define __SCANIOUTILS_HPP__
3 
4 #include <fstream>
5 #include <iostream>
6 #include <string>
7 #include <sstream>
8 #include <iomanip>
9 #include <set>
10 
11 #include <boost/filesystem.hpp>
12 #include <Eigen/Dense>
13 
14 #include "lvr2/io/Timestamp.hpp"
15 #include "lvr2/io/PLYIO.hpp"
16 #include "lvr2/types/ScanTypes.hpp"
18 
19 namespace lvr2
20 {
21 
30 std::string getSensorType(const boost::filesystem::path& dir);
31 
32 
36 
37 void saveScanImage(
38  const boost::filesystem::path& root,
39  const ScanImage& image,
40  const size_t& positionNumber,
41  const size_t& cameraNumber,
42  const size_t& imageNumber);
43 
44 void saveScanImage(
45  const boost::filesystem::path& root,
46  const ScanImage& image,
47  const std::string positionDirectory,
48  const size_t& cameraNumber,
49  const size_t& imageNumber);
50 
51 void saveScanImage(
52  const boost::filesystem::path& root,
53  const ScanImage& image,
54  const std::string positionDirectory,
55  const std::string cameraDirectory,
56  const size_t& imageNr);
57 
58 bool loadScanImage(
59  const boost::filesystem::path& root,
60  ScanImage& image,
61  const std::string& positionDirectory,
62  const size_t& cameraNumber,
63  const size_t& imageNumber);
64 
65 bool loadScanImage(
66  const boost::filesystem::path& root,
67  ScanImage& image,
68  const size_t& positionNumber,
69  const size_t& cameraNumber,
70  const size_t& imageNumber);
71 
72 bool loadScanImage(
73  const boost::filesystem::path& root,
74  ScanImage& image,
75  const std::string& positionDirectory,
76  const std::string& cameraDirectory,
77  const size_t& imageNumber);
78 
79 void loadScanImages(
80  vector<ScanImagePtr>& images,
81  boost::filesystem::path dataPath);
82 
86 
87 void saveScanCamera(
88  const boost::filesystem::path& root,
89  const ScanCamera& image,
90  const std::string positionDirectory,
91  const std::string cameraDirectory);
92 
93 void saveScanCamera(
94  const boost::filesystem::path& root,
95  const ScanCamera& image,
96  const size_t& positionNumber,
97  const size_t& cameraNumber);
98 
99 void saveScanCamera(
100  const boost::filesystem::path& root,
101  const ScanCamera& image,
102  const std::string& positionDirectory,
103  const size_t& cameraNumber);
104 
105 bool loadScanCamera(
106  const boost::filesystem::path& root,
107  ScanCamera& image,
108  const std::string& positionDirectory,
109  const std::string& cameraDirectory);
110 
111 bool loadScanCamera(
112  const boost::filesystem::path& root,
113  ScanCamera& image,
114  const std::string& positionDirectory,
115  const size_t& cameraNumber);
116 
117 bool loadScanCamera(
118  const boost::filesystem::path& root,
119  ScanCamera& image,
120  const size_t& positionNumber,
121  const size_t& cameraNumber);
122 
126 
136 void saveScan(
137  const boost::filesystem::path& root,
138  const Scan& scan,
139  const std::string positionName,
140  const std::string scanDirectoryName,
141  const std::string scanName);
142 
143 void saveScan(
144  const boost::filesystem::path& root,
145  const Scan& scan,
146  const std::string positionDirectory,
147  const std::string scanDirectory,
148  const size_t& scanNumber);
149 
150 void saveScan(
151  const boost::filesystem::path& root,
152  const Scan& scan,
153  const size_t& positionNumber,
154  const size_t& scanNumber);
155 
156 bool loadScan(
157  const boost::filesystem::path& root,
158  Scan& scan,
159  const std::string& positionDirectory,
160  const std::string& scanDirectory,
161  const std::string& scanName);
162 
163 bool loadScan(
164  const boost::filesystem::path& root,
165  Scan& scan,
166  const std::string& positionDirectory,
167  const std::string& scanDirectory,
168  const size_t& scanNumber);
169 
170 bool loadScan(
171  const boost::filesystem::path& root,
172  Scan& scan,
173  const size_t& positionNumber,
174  const size_t& scanNumber);
175 
176 
180 
190 void saveScanPosition(
191  const boost::filesystem::path& root,
192  const ScanPosition& scanPos,
193  const std::string positionDirectory);
194 
195 void saveScanPosition(
196  const boost::filesystem::path& root,
197  const ScanPosition& scanPos,
198  const size_t& positionNumber);
199 
200 bool loadScanPosition(
201  const boost::filesystem::path& root,
202  ScanPosition& scanPos,
203  const std::string& positionDirectory);
204 
205 bool loadScanPosition(
206  const boost::filesystem::path& root,
207  ScanPosition& scanPos,
208  const size_t& positionNumber);
209 
210 
214 
221 void saveScanProject(
222  const boost::filesystem::path& root,
223  const ScanProject& scanProj);
224 
225 bool loadScanProject(
226  const boost::filesystem::path& root,
227  ScanProject& scanProj);
228 
229 
230 // std::set<size_t> loadPositionIdsFromDirectory(
231 // const boost::filesystem::path& path
232 // );
233 
234 // std::set<size_t> loadCamIdsFromDirectory(
235 // const boost::filesystem::path& path,
236 // const size_t& positionNr
237 // );
238 
239 // std::set<size_t> loadImageIdsFromDirectory(
240 // const boost::filesystem::path& path,
241 // const size_t& positionNr,
242 // const size_t& camNr
243 // );
244 
245 // void saveScanToDirectory(const boost::filesystem::path& path, const Scan& scan, const size_t& positionNr);
246 
247 // bool loadScanFromDirectory(const boost::filesystem::path&, Scan& scan, const size_t& positionNr, bool loadData);
248 
249 // void saveScanToHDF5(const std::string filename, const size_t& positionNr);
250 
251 // bool loadScanFromHDF5(const std::string filename, const size_t& positionNr);
252 
253 // void saveScanImageToDirectory(
254 // const boost::filesystem::path& path,
255 // const std::string& camDir,
256 // const ScanImage& image,
257 // const size_t& positionNr,
258 // const size_t& imageNr);
259 
260 // bool loadScanImageFromDirectory(
261 // const boost::filesystem::path& path,
262 // const std::string& camDir,
263 // ScanImage& image,
264 // const size_t& positionNr,
265 // const size_t& imageNr);
266 
267 
268 
269 // void saveScanPositionToDirectory(const boost::filesystem::path& path, const ScanPosition& position, const size_t& positionNr);
270 
271 // bool loadScanPositionFromDirectory(const boost::filesystem::path& path, ScanPosition& position, const size_t& positionNr);
272 
273 // void saveScanProjectToDirectory(const boost::filesystem::path& path, const ScanProject& position);
274 
275 // bool loadScanProjectFromDirectory(const boost::filesystem::path& path, ScanProject& position);
276 
277 // void writeScanMetaYAML(const boost::filesystem::path& path, const Scan& scan);
278 
279 // void writeScanImageMetaYAML(const boost::filesystem::path& path, const ScanImage& image);
280 
281 // void loadScanMetaInfoFromYAML(const boost::filesystem::path& path, Scan& scan);
282 
283 // void loadImageMetaInfoFromYAML(const boost::filesystem::path&, ScanImage& image);
284 
285 // void loadPinholeModelFromYAML(const boost::filesystem::path& path, PinholeModeld& model);
286 
287 // void writePinholeModelToYAML(const boost::filesystem::path& path, const PinholeModeld& model);
288 
289 
290 } // namespace lvr2
291 
292 #endif
lvr2::getSensorType
std::string getSensorType(const boost::filesystem::path &dir)
Gets the sensor type for a given directory. Return an empty string if the directory does not contain ...
Definition: ScanIOUtils.cpp:19
CameraModels.hpp
lvr2::loadScan
bool loadScan(const boost::filesystem::path &root, Scan &scan, const std::string &positionDirectory, const std::string &scanDirectory, const std::string &scanName)
Definition: ScanIOUtils.cpp:487
ScanTypes.hpp
lvr2::saveScanCamera
void saveScanCamera(const boost::filesystem::path &root, const ScanCamera &image, const std::string positionDirectory, const std::string cameraDirectory)
SCANCAMERA.
Definition: ScanIOUtils.cpp:254
lvr2::loadScanPosition
bool loadScanPosition(const boost::filesystem::path &root, ScanPosition &scanPos, const std::string &positionDirectory)
Definition: ScanIOUtils.cpp:951
lvr2::loadScanImage
bool loadScanImage(const boost::filesystem::path &root, ScanImage &image, const std::string &positionDirectory, const size_t &cameraNumber, const size_t &imageNumber)
Definition: ScanIOUtils.cpp:141
lvr2::saveScanImage
void saveScanImage(const boost::filesystem::path &root, const ScanImage &image, const size_t &positionNumber, const size_t &cameraNumber, const size_t &imageNumber)
SCANIMAGE.
Definition: ScanIOUtils.cpp:38
lvr2::saveScanPosition
void saveScanPosition(const boost::filesystem::path &root, const ScanPosition &scanPos, const std::string positionDirectory)
SCAN_POSITION.
Definition: ScanIOUtils.cpp:888
lvr2::loadScanProject
bool loadScanProject(const boost::filesystem::path &root, ScanProject &scanProj)
Definition: ScanIOUtils.cpp:1083
lvr2
Definition: BaseBufferManipulators.hpp:39
PLYIO.hpp
I/O support for PLY files.
Timestamp.hpp
lvr2::saveScan
void saveScan(const boost::filesystem::path &root, const Scan &scan, const std::string positionName, const std::string scanDirectoryName, const std::string scanName)
SCAN.
Definition: ScanIOUtils.cpp:379
lvr2::saveScanProject
void saveScanProject(const boost::filesystem::path &root, const ScanProject &scanProj)
SCAN_PROJECT.
Definition: ScanIOUtils.cpp:1046
lvr2::loadScanCamera
bool loadScanCamera(const boost::filesystem::path &root, ScanCamera &image, const std::string &positionDirectory, const std::string &cameraDirectory)
Definition: ScanIOUtils.cpp:346
lvr2::loadScanImages
void loadScanImages(vector< ScanImagePtr > &images, boost::filesystem::path dataPath)


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