Projection.hpp
Go to the documentation of this file.
1 
28 #ifndef PROJECTION_H
29 #define PROJECTION_H
30 #include <cmath>
31 
33 
34 namespace lvr2
35 {
36 
38 {
39 public:
40 
41  Projection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
42 
43  virtual void project(int&i , int&j, float& r, float x, float y, float z) = 0;
44 
45  int w() { return m_width;}
46  int h() { return m_height;}
47 
48 protected:
49 
50  inline void toPolar(const float point[], float polar[]);
51 
52  float m_xSize;
53  float m_ySize;
54  float m_xFactor;
55  float m_yFactor;
56  int m_width;
57  int m_height;
58  float m_minH;
59  float m_maxH;
60  float m_minV;
61  float m_maxV;
62 
63  bool m_optimize;
65 
66  void setImageRatio();
67 
68  static constexpr float m_ph = 1.570796327;
69 };
70 
72 {
73 public:
74  EquirectangularProjection(int width, int height,
75  int minH, int maxH,
76  int minV, int maxV,
78 
79  virtual void project(int&i , int&j, float& r, float x, float y, float z) override;
80 
81 protected:
82  float m_xFactor;
83  float m_yFactor;
86  float m_lowShift;
87 };
88 
90 {
91 public:
92  MercatorProjection(int width, int height,
93  int minH, int maxH,
94  int minV, int maxV,
96 protected:
97  float m_heightLow;
100 };
101 
103 {
104 public:
105  CylindricalProjection(int width, int height,
106  int minH, int maxH,
107  int minV, int maxV,
108  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
109 
110 protected:
111  float m_heightLow;
114 };
115 
116 
118 {
119 public:
120  ConicProjection(int width, int height,
121  int minH, int maxH,
122  int minV, int maxV,
123  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
124 
125 protected:
126  float m_lat0;
127  float m_long0;
128  float m_lat1;
129  float m_phi1;
130  float m_phi2;
131  float m_n;
132  float m_c;
133  float m_rho0;
134  float m_maxX;
135  float m_minX;
136  float m_minY;
137  float m_maxY;
140 
141 };
142 
144 {
145 public:
146  RectilinearProjection(int width, int height,
147  int minH, int maxH,
148  int minV, int maxV,
149  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
150 protected:
151  float m_interval;
152  float m_iMinY;
153  float m_iMaxY;
154  float m_iMinX;
155  float m_iMaxX;
157  float m_l0;
159  float m_max;
160  float m_min;
161  float m_p1;
162 
163 };
164 
166 {
167 public:
168  PanniniProjection(int width, int height,
169  int minH, int maxH,
170  int minV, int maxV,
171  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
172 
173 protected:
174  float m_interval;
175  float m_iMinY;
176  float m_iMaxY;
177  float m_iMinX;
178  float m_iMaxX;
179  float m_max;
180  float m_min;
181  float m_l0;
182  float m_sPannini;
183  float m_p1;
184 };
185 
187 {
188 public:
189  StereographicProjection(int width, int height,
190  int minH, int maxH,
191  int minV, int maxV,
192  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
193 
194 protected:
195  float m_interval;
196  float m_iMinY;
197  float m_iMaxY;
198  float m_iMinX;
199  float m_iMaxX;
200  float m_max;
201  float m_min;
202  float m_l0;
203  float m_p1;
204  float m_k;
205 };
206 
208 {
209 public:
210  AzimuthalProjection(int width, int height,
211  int minH, int maxH,
212  int minV, int maxV,
213  bool optimize, ModelToImage::CoordinateSystem system = ModelToImage::NATIVE);
214 
215 protected:
216  float m_kPrime;
217  float m_long0;
218  float m_phi1;
219  float m_maxX;
220  float m_minX;
221  float m_minY;
222  float m_maxY;
225 };
226 
227 
228 } // namespace lvr2
229 
230 #endif // PROJECTION_H
lvr2::PanniniProjection::m_sPannini
float m_sPannini
Definition: Projection.hpp:182
lvr2::Projection::m_minV
float m_minV
Definition: Projection.hpp:60
lvr2::EquirectangularProjection::m_maxHeight
int m_maxHeight
Definition: Projection.hpp:85
lvr2::PanniniProjection::m_p1
float m_p1
Definition: Projection.hpp:183
lvr2::StereographicProjection::m_k
float m_k
Definition: Projection.hpp:204
lvr2::RectilinearProjection
Definition: Projection.hpp:143
lvr2::StereographicProjection::m_iMinY
float m_iMinY
Definition: Projection.hpp:196
lvr2::AzimuthalProjection::AzimuthalProjection
AzimuthalProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:391
lvr2::Projection::m_width
int m_width
Definition: Projection.hpp:56
lvr2::StereographicProjection::m_l0
float m_l0
Definition: Projection.hpp:202
lvr2::StereographicProjection::m_p1
float m_p1
Definition: Projection.hpp:203
lvr2::Projection::m_xSize
float m_xSize
Definition: Projection.hpp:52
lvr2::StereographicProjection::m_iMaxY
float m_iMaxY
Definition: Projection.hpp:197
lvr2::CylindricalProjection::CylindricalProjection
CylindricalProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:250
lvr2::Projection::toPolar
void toPolar(const float point[], float polar[])
Definition: Projection.cpp:420
lvr2::PanniniProjection::m_iMinX
float m_iMinX
Definition: Projection.hpp:177
lvr2::StereographicProjection::m_max
float m_max
Definition: Projection.hpp:200
lvr2::CylindricalProjection::m_maxHeight
int m_maxHeight
Definition: Projection.hpp:113
lvr2::Projection::setImageRatio
void setImageRatio()
Definition: Projection.cpp:49
lvr2::EquirectangularProjection::EquirectangularProjection
EquirectangularProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:99
lvr2::StereographicProjection::m_iMaxX
float m_iMaxX
Definition: Projection.hpp:199
lvr2::Projection::m_xFactor
float m_xFactor
Definition: Projection.hpp:54
lvr2::Projection::m_maxV
float m_maxV
Definition: Projection.hpp:61
lvr2::CylindricalProjection
Definition: Projection.hpp:102
lvr2::ConicProjection::m_maxHeight
int m_maxHeight
Definition: Projection.hpp:139
lvr2::ConicProjection::m_minX
float m_minX
Definition: Projection.hpp:135
lvr2::Projection::m_minH
float m_minH
Definition: Projection.hpp:58
lvr2::AzimuthalProjection::m_minX
float m_minX
Definition: Projection.hpp:220
lvr2::RectilinearProjection::m_l0
float m_l0
Definition: Projection.hpp:157
lvr2::PanniniProjection::m_iMinY
float m_iMinY
Definition: Projection.hpp:175
lvr2::Projection
Definition: Projection.hpp:37
lvr2::StereographicProjection::StereographicProjection
StereographicProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:352
lvr2::ConicProjection::m_rho0
float m_rho0
Definition: Projection.hpp:133
lvr2::StereographicProjection::m_iMinX
float m_iMinX
Definition: Projection.hpp:198
lvr2::Projection::Projection
Projection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:37
lvr2::PanniniProjection::m_interval
float m_interval
Definition: Projection.hpp:174
lvr2::EquirectangularProjection
Definition: Projection.hpp:71
lvr2::ConicProjection::m_maxWidth
int m_maxWidth
Definition: Projection.hpp:138
lvr2::PanniniProjection::PanniniProjection
PanniniProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:317
lvr2::StereographicProjection
Definition: Projection.hpp:186
lvr2::Projection::m_ph
static constexpr float m_ph
Definition: Projection.hpp:68
lvr2::RectilinearProjection::m_iMinY
float m_iMinY
Definition: Projection.hpp:152
lvr2::RectilinearProjection::m_iMinX
float m_iMinX
Definition: Projection.hpp:154
lvr2::Projection::m_system
ModelToImage::CoordinateSystem m_system
Definition: Projection.hpp:64
lvr2::ModelToImage::NATIVE
@ NATIVE
Definition: ModelToImage.hpp:112
lvr2::EquirectangularProjection::m_yFactor
float m_yFactor
Definition: Projection.hpp:83
lvr2::AzimuthalProjection::m_long0
float m_long0
Definition: Projection.hpp:217
lvr2::ConicProjection::m_long0
float m_long0
Definition: Projection.hpp:127
lvr2::Projection::w
int w()
Definition: Projection.hpp:45
lvr2::AzimuthalProjection
Definition: Projection.hpp:207
lvr2::RectilinearProjection::m_iMaxY
float m_iMaxY
Definition: Projection.hpp:153
lvr2::AzimuthalProjection::m_maxHeight
int m_maxHeight
Definition: Projection.hpp:224
lvr2::ConicProjection::ConicProjection
ConicProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:217
lvr2::PanniniProjection::m_iMaxY
float m_iMaxY
Definition: Projection.hpp:176
lvr2::RectilinearProjection::m_min
float m_min
Definition: Projection.hpp:160
lvr2::Projection::m_optimize
bool m_optimize
Definition: Projection.hpp:63
lvr2::MercatorProjection::m_maxWidth
int m_maxWidth
Definition: Projection.hpp:98
lvr2::PanniniProjection::m_max
float m_max
Definition: Projection.hpp:179
lvr2::MercatorProjection::m_heightLow
float m_heightLow
Definition: Projection.hpp:97
lvr2::EquirectangularProjection::m_xFactor
float m_xFactor
Definition: Projection.hpp:82
lvr2::Projection::m_maxH
float m_maxH
Definition: Projection.hpp:59
lvr2::ConicProjection::m_lat0
float m_lat0
Definition: Projection.hpp:126
lvr2::ConicProjection::m_c
float m_c
Definition: Projection.hpp:132
lvr2::StereographicProjection::m_interval
float m_interval
Definition: Projection.hpp:195
lvr2::EquirectangularProjection::m_maxWidth
int m_maxWidth
Definition: Projection.hpp:84
lvr2::ModelToImage::CoordinateSystem
CoordinateSystem
Definition: ModelToImage.hpp:110
lvr2::RectilinearProjection::RectilinearProjection
RectilinearProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:283
lvr2::MercatorProjection::MercatorProjection
MercatorProjection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:267
lvr2::RectilinearProjection::m_p1
float m_p1
Definition: Projection.hpp:161
lvr2::Projection::project
virtual void project(int &i, int &j, float &r, float x, float y, float z)=0
lvr2::AzimuthalProjection::m_maxY
float m_maxY
Definition: Projection.hpp:222
lvr2::AzimuthalProjection::m_minY
float m_minY
Definition: Projection.hpp:221
lvr2::AzimuthalProjection::m_maxX
float m_maxX
Definition: Projection.hpp:219
lvr2::RectilinearProjection::m_coscRectlinear
float m_coscRectlinear
Definition: Projection.hpp:158
lvr2::Projection::m_yFactor
float m_yFactor
Definition: Projection.hpp:55
lvr2::Projection::m_height
int m_height
Definition: Projection.hpp:57
lvr2::CylindricalProjection::m_maxWidth
int m_maxWidth
Definition: Projection.hpp:112
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Projection::h
int h()
Definition: Projection.hpp:46
lvr2::Projection::m_ySize
float m_ySize
Definition: Projection.hpp:53
lvr2::ConicProjection::m_n
float m_n
Definition: Projection.hpp:131
ModelToImage.hpp
lvr2::RectilinearProjection::m_iMaxX
float m_iMaxX
Definition: Projection.hpp:155
lvr2::MercatorProjection::m_maxHeight
int m_maxHeight
Definition: Projection.hpp:99
lvr2::StereographicProjection::m_min
float m_min
Definition: Projection.hpp:201
lvr2::RectilinearProjection::m_coscRectilinear
float m_coscRectilinear
Definition: Projection.hpp:156
lvr2::ConicProjection::m_phi2
float m_phi2
Definition: Projection.hpp:130
lvr2::ConicProjection::m_maxX
float m_maxX
Definition: Projection.hpp:134
lvr2::ConicProjection
Definition: Projection.hpp:117
lvr2::AzimuthalProjection::m_maxWidth
int m_maxWidth
Definition: Projection.hpp:223
lvr2::PanniniProjection::m_min
float m_min
Definition: Projection.hpp:180
lvr2::CylindricalProjection::m_heightLow
float m_heightLow
Definition: Projection.hpp:111
lvr2::MercatorProjection
Definition: Projection.hpp:89
lvr2::RectilinearProjection::m_interval
float m_interval
Definition: Projection.hpp:151
lvr2::PanniniProjection::m_iMaxX
float m_iMaxX
Definition: Projection.hpp:178
lvr2::ConicProjection::m_lat1
float m_lat1
Definition: Projection.hpp:128
lvr2::ConicProjection::m_maxY
float m_maxY
Definition: Projection.hpp:137
lvr2::EquirectangularProjection::project
virtual void project(int &i, int &j, float &r, float x, float y, float z) override
Definition: Projection.cpp:119
lvr2::AzimuthalProjection::m_phi1
float m_phi1
Definition: Projection.hpp:218
lvr2::ConicProjection::m_minY
float m_minY
Definition: Projection.hpp:136
lvr2::EquirectangularProjection::m_lowShift
float m_lowShift
Definition: Projection.hpp:86
lvr2::AzimuthalProjection::m_kPrime
float m_kPrime
Definition: Projection.hpp:216
lvr2::RectilinearProjection::m_max
float m_max
Definition: Projection.hpp:159
lvr2::PanniniProjection::m_l0
float m_l0
Definition: Projection.hpp:181
lvr2::ConicProjection::m_phi1
float m_phi1
Definition: Projection.hpp:129
lvr2::PanniniProjection
Definition: Projection.hpp:165


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