HyperspectralCamera.hpp
Go to the documentation of this file.
1 
2 #ifndef LVR2_IO_YAML_HYPERSPECTRALCAMERAMETA_IO_HPP
3 #define LVR2_IO_YAML_HYPERSPECTRALCAMERAMETA_IO_HPP
4 
5 #include "MatrixIO.hpp"
7 
8 #include <yaml-cpp/yaml.h>
9 
10 namespace YAML
11 {
12 
19 // WRITE HYPERSPECTRALCAMERA PARTIALLY
20 template <>
21 struct convert<lvr2::HyperspectralCamera>
22 {
23 
27  static Node encode(const lvr2::HyperspectralCamera& camera)
28  {
29  Node node;
30 
31  node["sensor_type"] = lvr2::HyperspectralCamera::sensorType;
32 
33  node["focalLength"] = camera.focalLength;
34  node["offsetAngle"] = camera.offsetAngle;
35 
36  node["extrinsics"] = camera.extrinsics;
37  node["extrinsicsEstimate"] = camera.extrinsicsEstimate;
38 
39  node["principal"] = Load("[]");
40  node["principal"].push_back(camera.principal[0]);
41  node["principal"].push_back(camera.principal[1]);
42  node["principal"].push_back(camera.principal[2]);
43 
44  node["distortion"] = Load("[]");
45  node["distortion"].push_back(camera.principal[0]);
46  node["distortion"].push_back(camera.principal[1]);
47  node["distortion"].push_back(camera.principal[2]);
48 
49  return node;
50  }
51 
52  static bool decode(const Node& node, lvr2::HyperspectralCamera& camera)
53  {
54 
55  if (node["sensor_type"].as<std::string>() != lvr2::HyperspectralCamera::sensorType)
56  {
57  return false;
58  }
59 
60  camera.focalLength = node["focalLength"].as<double>();
61  camera.offsetAngle = node["offsetAngle"].as<double>();
62  camera.extrinsics = node["extrinsics"].as<lvr2::Extrinsicsd>();
63  camera.extrinsicsEstimate = node["extrinsicsEstimate"].as<lvr2::Extrinsicsd>();
64 
65  camera.principal[0] = node["principal"][0].as<double>();
66  camera.principal[1] = node["principal"][1].as<double>();
67  camera.principal[2] = node["principal"][1].as<double>();
68 
69  camera.distortion[0] = node["distortion"][0].as<double>();
70  camera.distortion[1] = node["distortion"][1].as<double>();
71  camera.distortion[2] = node["distortion"][1].as<double>();
72 
73  return true;
74  }
75 };
76 
77 } // namespace YAML
78 
79 #endif // LVR2_IO_YAML_HYPERSPECTRALCAMERAMETA_IO_HPP
YAML::convert< lvr2::HyperspectralCamera >::encode
static Node encode(const lvr2::HyperspectralCamera &camera)
Definition: HyperspectralCamera.hpp:27
lvr2::HyperspectralCamera::sensorType
static constexpr char sensorType[]
Sensor type flag.
Definition: ScanTypes.hpp:245
lvr2::HyperspectralCamera
Definition: ScanTypes.hpp:238
lvr2::HyperspectralCamera::extrinsics
Extrinsicsd extrinsics
Camera model.
Definition: ScanTypes.hpp:251
lvr2::HyperspectralCamera::focalLength
double focalLength
Focal length.
Definition: ScanTypes.hpp:257
YAML
Definition: LSROptionsYamlExtensions.hpp:42
lvr2::Extrinsicsd
Extrinsics< double > Extrinsicsd
4x4 extrinsic calibration (double precision)
Definition: MatrixTypes.hpp:91
ScanTypes.hpp
lvr2::HyperspectralCamera::principal
Vector3d principal
Principal x, y, z.
Definition: ScanTypes.hpp:263
lvr2::convert
void convert(COORD_SYSTEM from, COORD_SYSTEM to, float *point)
Definition: CoordinateTransform.cpp:46
YAML::convert< lvr2::HyperspectralCamera >::decode
static bool decode(const Node &node, lvr2::HyperspectralCamera &camera)
Definition: HyperspectralCamera.hpp:52
lvr2::HyperspectralCamera::distortion
Vector3d distortion
Distortion.
Definition: ScanTypes.hpp:266
MatrixIO.hpp
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::HyperspectralCamera::extrinsicsEstimate
Extrinsicsd extrinsicsEstimate
Extrinsics estimate.
Definition: ScanTypes.hpp:254
lvr2::HyperspectralCamera::offsetAngle
double offsetAngle
Offset angle.
Definition: ScanTypes.hpp:260


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