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 
82  bool pointsLoaded;
83 
85  int positionNumber;
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
lvr2::ScanCamera::camera
PinholeModeld camera
Pinhole camera model.
Definition: ScanTypes.hpp:153
lvr2::ScanCamera::sensorName
std::string sensorName
Individual name of the camera.
Definition: ScanTypes.hpp:150
lvr2::ScanCamera::images
std::vector< ScanImagePtr > images
Pointer to a set of images taken at a scan position.
Definition: ScanTypes.hpp:156
lvr2::Scan::numPoints
size_t numPoints
Number of points in scan.
Definition: ScanTypes.hpp:96
lvr2::HyperspectralPanoramaChannelOptional
boost::optional< HyperspectralPanoramaChannel > HyperspectralPanoramaChannelOptional
Definition: ScanTypes.hpp:178
lvr2::ScanProjectEditMarkPtr
std::shared_ptr< ScanProjectEditMark > ScanProjectEditMarkPtr
Definition: ScanTypes.hpp:357
lvr2::ScanProjectEditMark
Definition: ScanTypes.hpp:350
lvr2::HyperspectralPanoramaChannel::timestamp
double timestamp
Timestamp.
Definition: ScanTypes.hpp:172
lvr2::HyperspectralCamera::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:245
lvr2::Scan::boundingBox
BoundingBox< BaseVector< float > > boundingBox
Axis aligned bounding box of this scan.
Definition: ScanTypes.hpp:56
lvr2::HyperspectralPanoramaChannel::channel
cv::Mat channel
OpenCV representation.
Definition: ScanTypes.hpp:178
lvr2::HyperspectralCamera::panoramas
std::vector< HyperspectralPanoramaPtr > panoramas
OpenCV representation.
Definition: ScanTypes.hpp:269
lvr2::HyperspectralPanoramaChannelPtr
std::shared_ptr< HyperspectralPanoramaChannel > HyperspectralPanoramaChannelPtr
Definition: ScanTypes.hpp:177
lvr2::ScanPosition::latitude
double latitude
Latitude (optional)
Definition: ScanTypes.hpp:296
lvr2::HyperspectralPanorama::channels
std::vector< HyperspectralPanoramaChannelPtr > channels
OpenCV representation.
Definition: ScanTypes.hpp:196
lvr2::HyperspectralCameraModel::distortion
Vector3d distortion
Distortion.
Definition: ScanTypes.hpp:230
lvr2::ScanImagePtr
std::shared_ptr< ScanImage > ScanImagePtr
Definition: ScanTypes.hpp:127
lvr2::ScanPosition::hyperspectralCamera
HyperspectralCameraPtr hyperspectralCamera
Image data (optional, empty vector of no hyperspactral panoramas were taken)
Definition: ScanTypes.hpp:293
lvr2::HyperspectralCameraModel::extrinsicsEstimate
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:218
lvr2::HyperspectralCamera
Definition: ScanTypes.hpp:238
lvr2::ScanPosition::timestamp
double timestamp
Timestamp when this position was created.
Definition: ScanTypes.hpp:311
lvr2::HyperspectralCameraModel::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:212
lvr2::HyperspectralCamera::extrinsics
Extrinsicsd extrinsics
Camera model.
Definition: ScanTypes.hpp:251
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::ScanCamera::sensorType
static constexpr char sensorType[]
Description of the sensor model.
Definition: ScanTypes.hpp:147
lvr2::HyperspectralCamera::focalLength
double focalLength
Focal length.
Definition: ScanTypes.hpp:257
CameraModels.hpp
lvr2::ScanProjectPtr
std::shared_ptr< ScanProject > ScanProjectPtr
Definition: ScanTypes.hpp:344
lvr2::Scan::hResolution
double hResolution
Horizontal resolution of used laser scanner.
Definition: ScanTypes.hpp:71
lvr2::Scan::poseEstimation
Transformd poseEstimation
Pose estimation of this scan in project coordinates.
Definition: ScanTypes.hpp:53
lvr2::ScanImageOptional
boost::optional< ScanImage > ScanImageOptional
Definition: ScanTypes.hpp:128
lvr2::ScanPosition::longitude
double longitude
Longitude (optional)
Definition: ScanTypes.hpp:299
lvr2::PinholeModel< double >
lvr2::Scan::scanRoot
boost::filesystem::path scanRoot
Path to root dir of this scan.
Definition: ScanTypes.hpp:90
lvr2::ScanProjectEditMark::changed
std::vector< bool > changed
True if scan pose has been changed, one bool for each scan position.
Definition: ScanTypes.hpp:357
lvr2::ScanOptional
boost::optional< Scan > ScanOptional
Definition: ScanTypes.hpp:99
lvr2::Extrinsicsd
Extrinsics< double > Extrinsicsd
4x4 extrinsic calibration (double precision)
Definition: MatrixTypes.hpp:91
lvr2::ScanPosition::sensorType
static constexpr char sensorType[]
Definition: ScanTypes.hpp:282
lvr2::Scan::endTime
double endTime
End timestamp
Definition: ScanTypes.hpp:80
lvr2::ScanProject::coordinateSystem
std::string coordinateSystem
Definition: ScanTypes.hpp:349
lvr2::HyperspectralCameraModel
Definition: ScanTypes.hpp:205
lvr2::Scan
Definition: ScanTypes.hpp:24
lvr2::ScanImage::image
cv::Mat image
OpenCV representation.
Definition: ScanTypes.hpp:126
lvr2::HyperspectralCamera::principal
Vector3d principal
Principal x, y, z.
Definition: ScanTypes.hpp:263
lvr2::ScanPosition
Definition: ScanTypes.hpp:276
lvr2::HyperspectralPanoramaPtr
std::shared_ptr< HyperspectralPanorama > HyperspectralPanoramaPtr
Definition: ScanTypes.hpp:195
lvr2::ScanPositionPtr
std::shared_ptr< ScanPosition > ScanPositionPtr
Definition: ScanTypes.hpp:311
lvr2::HyperspectralPanoramaChannel
Definition: ScanTypes.hpp:162
lvr2::ScanCamera
Definition: ScanTypes.hpp:138
lvr2::Scan::phiMax
double phiMax
Max vertical scan angle.
Definition: ScanTypes.hpp:68
PointBuffer.hpp
lvr2::ScanImage::extrinsicsEstimate
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:120
lvr2::HyperspectralPanoramaChannel::channelFile
boost::filesystem::path channelFile
Path to stored image.
Definition: ScanTypes.hpp:175
lvr2::HyperspectralCameraModel::principal
Vector3d principal
Principal x, y, z.
Definition: ScanTypes.hpp:227
MatrixTypes.hpp
lvr2::Scan::pointsLoaded
bool pointsLoaded
Definition: ScanTypes.hpp:84
lvr2::HyperspectralCameraPtr
std::shared_ptr< HyperspectralCamera > HyperspectralCameraPtr
Definition: ScanTypes.hpp:268
lvr2::ScanPosition::altitude
double altitude
Longitude (optional)
Definition: ScanTypes.hpp:302
lvr2::ScanImage
Definition: ScanTypes.hpp:107
lvr2::Vector3d
Eigen::Vector3d Vector3d
Eigen 3D vector, double precision.
Definition: MatrixTypes.hpp:121
lvr2::ScanPosition::scans
std::vector< ScanPtr > scans
Definition: ScanTypes.hpp:287
lvr2::HyperspectralCamera::distortion
Vector3d distortion
Distortion.
Definition: ScanTypes.hpp:266
lvr2::HyperspectralCameraModel::offsetAngle
double offsetAngle
Offset angle.
Definition: ScanTypes.hpp:224
lvr2::ScanProject
Definition: ScanTypes.hpp:322
lvr2::Scan::points
PointBufferPtr points
Point buffer containing the scan points.
Definition: ScanTypes.hpp:47
lvr2::Scan::startTime
double startTime
Start timestamp.
Definition: ScanTypes.hpp:77
lvr2::HyperspectralCameraModel::focalLength
double focalLength
Focal length.
Definition: ScanTypes.hpp:221
lvr2::BoundingBox
A dynamic bounding box class.
Definition: BoundingBox.hpp:49
lvr2::HyperspectralPanorama
Definition: ScanTypes.hpp:186
lvr2::Scan::thetaMin
double thetaMin
Min horizontal scan angle.
Definition: ScanTypes.hpp:59
lvr2::HyperspectralCameraModelPtr
std::shared_ptr< HyperspectralCameraModel > HyperspectralCameraModelPtr
Definition: ScanTypes.hpp:229
lvr2::Scan::sensorType
static constexpr char sensorType[]
Definition: ScanTypes.hpp:44
lvr2::ScanPosition::pose_estimate
Transformd pose_estimate
Estimated pose.
Definition: ScanTypes.hpp:305
lvr2::Scan::registration
Transformd registration
Registration of this scan in project coordinates.
Definition: ScanTypes.hpp:50
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::ScanImage::imageFile
boost::filesystem::path imageFile
Path to stored image.
Definition: ScanTypes.hpp:123
lvr2::HyperspectralCamera::extrinsicsEstimate
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:254
lvr2::HyperspectralPanoramaChannel::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:169
lvr2::Scan::~Scan
~Scan()
Definition: ScanTypes.hpp:42
lvr2::Scan::thetaMax
double thetaMax
Max horizontal scan angle.
Definition: ScanTypes.hpp:62
lvr2::ScanProjectEditMark::project
ScanProjectPtr project
Definition: ScanTypes.hpp:355
lvr2::ScanPosition::cams
std::vector< ScanCameraPtr > cams
Image data (optional, empty vector of no images were taken)
Definition: ScanTypes.hpp:290
lvr2::HyperspectralCameraModel::extrinsics
Extrinsicsd extrinsics
Extrinsics.
Definition: ScanTypes.hpp:215
lvr2::HyperspectralCamera::offsetAngle
double offsetAngle
Offset angle.
Definition: ScanTypes.hpp:260
lvr2::HyperspectralPanorama::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:193
lvr2::ScanImage::extrinsics
Extrinsicsd extrinsics
Extrinsics.
Definition: ScanTypes.hpp:117
lvr2::Scan::phiMin
double phiMin
Min vertical scan angle.
Definition: ScanTypes.hpp:65
lvr2::HyperspectralPanoramaOptional
boost::optional< HyperspectralPanorama > HyperspectralPanoramaOptional
Definition: ScanTypes.hpp:196
lvr2::ScanPosition::registration
Transformd registration
Final registered position in project coordinates.
Definition: ScanTypes.hpp:308
lvr2::Scan::vResolution
double vResolution
Vertical resolution of used laser scanner.
Definition: ScanTypes.hpp:74
lvr2::Scan::Scan
Scan()
Definition: ScanTypes.hpp:28
BoundingBox.hpp
lvr2::ScanImage::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:114
lvr2::ScanProject::positions
std::vector< ScanPositionPtr > positions
Vector of scan positions for this project.
Definition: ScanTypes.hpp:344
lvr2::ScanProject::sensorName
std::string sensorName
Individual name of used laser scanner.
Definition: ScanTypes.hpp:336
lvr2::ScanProject::pose
Transformd pose
Definition: ScanTypes.hpp:341
lvr2::Scan::scanFile
boost::filesystem::path scanFile
Name of the file containing the scan data.
Definition: ScanTypes.hpp:93
lvr2::ScanCameraPtr
std::shared_ptr< ScanCamera > ScanCameraPtr
Definition: ScanTypes.hpp:153
lvr2::ScanPtr
std::shared_ptr< Scan > ScanPtr
Shared pointer to scans.
Definition: ScanTypes.hpp:98
lvr2::Scan::positionNumber
int positionNumber
Scan position number of this scan in the current scan project.
Definition: ScanTypes.hpp:87
lvr2::ScanProject::sensorType
static constexpr char sensorType[]
Type of used laser scanner.
Definition: ScanTypes.hpp:333


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