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
Projection(int width, int height, int minH, int maxH, int minV, int maxV, bool optimize, ModelToImage::CoordinateSystem system=ModelToImage::NATIVE)
Definition: Projection.cpp:37
void setImageRatio()
Definition: Projection.cpp:49
ModelToImage::CoordinateSystem m_system
Definition: Projection.hpp:64
virtual void project(int &i, int &j, float &r, float x, float y, float z)=0
void toPolar(const float point[], float polar[])
Definition: Projection.cpp:420
static constexpr float m_ph
Definition: Projection.hpp:68


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