ScanTypes.hpp
Go to the documentation of this file.
1 #ifndef __SCANTYPES_HPP__
2 #define __SCANTYPES_HPP__
3 
8 
9 #include <boost/optional.hpp>
10 #include <boost/filesystem.hpp>
11 #include <string_view>
12 
13 #include <opencv2/core.hpp>
14 
15 #include <memory>
16 #include <vector>
17 
18 namespace lvr2
19 {
20 
21 /*****************************************************************************
22  * @brief Class to represent a scan within a scan project
23  ****************************************************************************/
24 struct Scan
25 {
26  Scan() :
27  points(nullptr),
28  registration(Transformd::Identity()),
29  poseEstimation(Transformd::Identity()),
30  thetaMin(0), thetaMax(0),
31  phiMin(0), phiMax(0),
32  hResolution(0),
33  vResolution(0),
34  pointsLoaded(false),
35  positionNumber(0),
36  numPoints(0),
37  scanRoot(boost::filesystem::path("./"))
38  {}
39 
40  ~Scan() {};
41 
42  static constexpr char sensorType[] = "Scan";
43 
46 
49 
52 
55 
57  double thetaMin;
58 
60  double thetaMax;
61 
63  double phiMin;
64 
66  double phiMax;
67 
69  double hResolution;
70 
72  double vResolution;
73 
75  double startTime;
76 
78  double endTime;
79 
83 
86 
88  boost::filesystem::path scanRoot;
89 
91  boost::filesystem::path scanFile;
92 
94  size_t numPoints;
95 };
96 
98 using ScanPtr = std::shared_ptr<Scan>;
99 using ScanOptional = boost::optional<Scan>;
100 
101 /*****************************************************************************
102  * @brief Struct to hold a camera image together with intrinsic
103  * and extrinsic camera parameters
104  *
105  *****************************************************************************/
106 
107 struct ScanImage
108 {
110  static constexpr char sensorType[] = "ScanImage";
111 
114 
117 
119  boost::filesystem::path imageFile;
120 
122  cv::Mat image;
123 };
124 
125 
126 
127 using ScanImagePtr = std::shared_ptr<ScanImage>;
128 using ScanImageOptional = boost::optional<ScanImage>;
129 
130 
131 /*****************************************************************************
132  * @brief Represents a camera that was used at a specific scan
133  * position. The intrinsic calibration is stored in the
134  * camera's camera field. Each image has its owen orientation
135  * (extrinsic matrix) with respect to the laser scanner
136  *
137  ****************************************************************************/
138 struct ScanCamera
139 {
141  static constexpr char sensorType[] = "ScanCamera";
142 
144  std::string sensorName = "Camera";
145 
148 
150  std::vector<ScanImagePtr> images;
151 };
152 
153 using ScanCameraPtr = std::shared_ptr<ScanCamera>;
154 
155 
156 /*****************************************************************************
157  * @brief Struct to hold a camera hyperspectral panorama
158  * together with a timestamp
159  *
160  *****************************************************************************/
161 
163 {
165  static constexpr char sensorType[] = "HyperspectralPanoramaChannel";
166 
168  double timestamp;
169 
171  boost::filesystem::path channelFile;
172 
174  cv::Mat channel;
175 };
176 
177 using HyperspectralPanoramaChannelPtr = std::shared_ptr<HyperspectralPanoramaChannel>;
178 using HyperspectralPanoramaChannelOptional = boost::optional<HyperspectralPanoramaChannel>;
179 
180 /*****************************************************************************
181  * @brief Struct to hold a camera hyperspectral panorama
182  * together with a timestamp
183  *
184  *****************************************************************************/
185 
187 {
189  static constexpr char sensorType[] = "HyperspectralPanorama";
190 
192  std::vector<HyperspectralPanoramaChannelPtr> channels;
193 };
194 
195 using HyperspectralPanoramaPtr = std::shared_ptr<HyperspectralPanorama>;
196 using HyperspectralPanoramaOptional = boost::optional<HyperspectralPanorama>;
197 
198 
199 /*****************************************************************************
200  * @brief Struct to hold a hyperspectral camera model
201  * together with intrinsic, extrinsic and further parameters
202  *
203  *****************************************************************************/
204 
206 {
208  static constexpr char sensorType[] = "HyperspectralCameraModel";
209 
212 
215 
217  double focalLength;
218 
220  double offsetAngle;
221 
224 
227 };
228 
229 using HyperspectralCameraModelPtr = std::shared_ptr<HyperspectralCameraModel>;
230 
231 
232 /*****************************************************************************
233  * @brief Struct to hold a hyperspectral camera
234  * together with it's camera model and panoramas
235  *
236  *****************************************************************************/
237 
239 {
241  static constexpr char sensorType[] = "HyperspectralCamera";
242 
244  // HyperspectralCameraModelPtr cameraModel;
245 
248 
251 
253  double focalLength;
254 
256  double offsetAngle;
257 
260 
263 
265  std::vector<HyperspectralPanoramaPtr> panoramas;
266 };
267 
268 using HyperspectralCameraPtr = std::shared_ptr<HyperspectralCamera>;
269 
270 
271 /*****************************************************************************
272  * @brief Represents a scan position consisting of a scan and
273  * images taken at this position
274  *
275  ****************************************************************************/
277 {
278  static constexpr char sensorType[] = "ScanPosition";
279 
283  std::vector<ScanPtr> scans;
284 
286  std::vector<ScanCameraPtr> cams;
287 
290 
292  double latitude = 0.0;
293 
295  double longitude = 0.0;
296 
298  double altitude = 0.0;
299 
302 
305 
307  double timestamp = 0.0;
308 
309 };
310 
311 using ScanPositionPtr = std::shared_ptr<ScanPosition>;
312 
313 /*****************************************************************************
314  * @brief Struct to represent a scan project consisting
315  * of a set of scan position. Each scan position
316  * can consist of a laser scan and an set of acquired
317  * images. All scan position are numbered incrementally.
318  * If an optional for a scan position returns false,
319  * the corresponding data is not available for this
320  * scan position number.
321  *****************************************************************************/
323 {
325  static constexpr char sensorType[] = "ScanProject";
326 
328  std::string sensorName;
329 
334 
336  std::vector<ScanPositionPtr> positions;
337 
341  std::string coordinateSystem;
342 };
343 
344 using ScanProjectPtr = std::shared_ptr<ScanProject>;
345 
346 /*****************************************************************************
347  * @brief Struct to represent a scan project with marker showing if a scan
348  * pose has been changed
349  *****************************************************************************/
351 {
354  std::vector<bool> changed;
355 };
356 
357 using ScanProjectEditMarkPtr = std::shared_ptr<ScanProjectEditMark>;
358 
359 } // namespace lvr2
360 
361 #endif
Vector3d principal
Principal x, y, z.
Definition: ScanTypes.hpp:259
std::shared_ptr< HyperspectralPanoramaChannel > HyperspectralPanoramaChannelPtr
Definition: ScanTypes.hpp:177
double hResolution
Horizontal resolution of used laser scanner.
Definition: ScanTypes.hpp:69
bool pointsLoaded
Definition: ScanTypes.hpp:82
cv::Mat channel
OpenCV representation.
Definition: ScanTypes.hpp:174
Vector3d distortion
Distortion.
Definition: ScanTypes.hpp:262
PinholeModeld camera
Pinhole camera model.
Definition: ScanTypes.hpp:147
double startTime
Start timestamp.
Definition: ScanTypes.hpp:75
Transformd registration
Final registered position in project coordinates.
Definition: ScanTypes.hpp:304
boost::filesystem::path imageFile
Path to stored image.
Definition: ScanTypes.hpp:119
std::vector< HyperspectralPanoramaChannelPtr > channels
OpenCV representation.
Definition: ScanTypes.hpp:192
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:250
static Timestamp timestamp
A global time stamp object for program runtime measurement.
Definition: Timestamp.hpp:116
ScanProjectPtr project
Definition: ScanTypes.hpp:352
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:116
std::shared_ptr< HyperspectralPanorama > HyperspectralPanoramaPtr
Definition: ScanTypes.hpp:195
Eigen::Vector3d Vector3d
Eigen 3D vector, double precision.
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Definition: ScanTypes.hpp:98
Extrinsicsd extrinsics
Extrinsics.
Definition: ScanTypes.hpp:211
int positionNumber
Scan position number of this scan in the current scan project.
Definition: ScanTypes.hpp:85
static constexpr char sensorType[]
Definition: ScanTypes.hpp:42
std::shared_ptr< PointBuffer > PointBufferPtr
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
boost::optional< HyperspectralPanorama > HyperspectralPanoramaOptional
Definition: ScanTypes.hpp:196
std::vector< ScanPositionPtr > positions
Vector of scan positions for this project.
Definition: ScanTypes.hpp:336
std::shared_ptr< ScanCamera > ScanCameraPtr
Definition: ScanTypes.hpp:153
Transform< double > Transformd
4x4 double precision transformation matrix
Definition: MatrixTypes.hpp:71
double endTime
End timestamp.
Definition: ScanTypes.hpp:78
std::vector< ScanCameraPtr > cams
Image data (optional, empty vector of no images were taken)
Definition: ScanTypes.hpp:286
double offsetAngle
Offset angle.
Definition: ScanTypes.hpp:256
Transformd poseEstimation
Pose estimation of this scan in project coordinates.
Definition: ScanTypes.hpp:51
double focalLength
Focal length.
Definition: ScanTypes.hpp:217
PointBufferPtr points
Point buffer containing the scan points.
Definition: ScanTypes.hpp:45
std::string sensorName
Individual name of used laser scanner.
Definition: ScanTypes.hpp:328
double phiMax
Max vertical scan angle.
Definition: ScanTypes.hpp:66
std::vector< HyperspectralPanoramaPtr > panoramas
OpenCV representation.
Definition: ScanTypes.hpp:265
Transformd pose
Definition: ScanTypes.hpp:333
boost::filesystem::path scanRoot
Path to root dir of this scan.
Definition: ScanTypes.hpp:88
std::shared_ptr< ScanProjectEditMark > ScanProjectEditMarkPtr
Definition: ScanTypes.hpp:357
Vector3d principal
Principal x, y, z.
Definition: ScanTypes.hpp:223
std::shared_ptr< ScanProject > ScanProjectPtr
Definition: ScanTypes.hpp:344
std::shared_ptr< HyperspectralCameraModel > HyperspectralCameraModelPtr
Definition: ScanTypes.hpp:229
double vResolution
Vertical resolution of used laser scanner.
Definition: ScanTypes.hpp:72
boost::optional< HyperspectralPanoramaChannel > HyperspectralPanoramaChannelOptional
Definition: ScanTypes.hpp:178
Transformd registration
Registration of this scan in project coordinates.
Definition: ScanTypes.hpp:48
Extrinsicsd extrinsics
Camera model.
Definition: ScanTypes.hpp:247
std::shared_ptr< HyperspectralCamera > HyperspectralCameraPtr
Definition: ScanTypes.hpp:268
double phiMin
Min vertical scan angle.
Definition: ScanTypes.hpp:63
boost::optional< ScanImage > ScanImageOptional
Definition: ScanTypes.hpp:128
std::shared_ptr< ScanImage > ScanImagePtr
Definition: ScanTypes.hpp:127
double focalLength
Focal length.
Definition: ScanTypes.hpp:253
size_t numPoints
Number of points in scan.
Definition: ScanTypes.hpp:94
std::vector< ScanPtr > scans
Definition: ScanTypes.hpp:283
double thetaMax
Max horizontal scan angle.
Definition: ScanTypes.hpp:60
std::string coordinateSystem
Definition: ScanTypes.hpp:341
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:214
boost::filesystem::path scanFile
Name of the file containing the scan data.
Definition: ScanTypes.hpp:91
boost::filesystem::path channelFile
Path to stored image.
Definition: ScanTypes.hpp:171
std::vector< ScanImagePtr > images
Pointer to a set of images taken at a scan position.
Definition: ScanTypes.hpp:150
Transformd pose_estimate
Estimated pose.
Definition: ScanTypes.hpp:301
Vector3d distortion
Distortion.
Definition: ScanTypes.hpp:226
HyperspectralCameraPtr hyperspectralCamera
Image data (optional, empty vector of no hyperspactral panoramas were taken)
Definition: ScanTypes.hpp:289
boost::optional< Scan > ScanOptional
Definition: ScanTypes.hpp:99
std::shared_ptr< ScanPosition > ScanPositionPtr
Definition: ScanTypes.hpp:311
BoundingBox< BaseVector< float > > boundingBox
Axis aligned bounding box of this scan.
Definition: ScanTypes.hpp:54
cv::Mat image
OpenCV representation.
Definition: ScanTypes.hpp:122
double thetaMin
Min horizontal scan angle.
Definition: ScanTypes.hpp:57
std::vector< bool > changed
True if scan pose has been changed, one bool for each scan position.
Definition: ScanTypes.hpp:354
Extrinsicsd extrinsics
Extrinsics.
Definition: ScanTypes.hpp:113
double offsetAngle
Offset angle.
Definition: ScanTypes.hpp:220
Extrinsics< double > Extrinsicsd
4x4 extrinsic calibration (double precision)
Definition: MatrixTypes.hpp:91


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:09