25 #ifndef __EIGHT_WAY_SYMMETRY_HH__
26 #define __EIGHT_WAY_SYMMETRY_HH__
27 #include "bias_config.h"
30 #define _USE_MATH_DEFINES
35 #include <Base/Debug/Error.hh>
61 const T& endx,
const T& endy);
66 const T& Originalx,
const T& Originaly,
67 T& Transformedx, T& Transformedy);
71 const T& Transformedx,
const T& Transformedy,
72 T& Originalx, T& Originaly);
75 const T orig[2], T transf[2]);
78 const T transf[2], T orig[2]);
92 if (angle >= 0 && angle <= M_PI_4)
94 if (angle > M_PI_4 && angle <= M_PI_2)
96 if (angle > M_PI_2 && angle <= 3 * M_PI_4)
98 if (angle > 3 * M_PI_4 && angle <= M_PI)
100 if (angle > -M_PI && angle <= -3 * M_PI_4)
102 if (angle > -3 * M_PI_4 && angle <= -M_PI_2)
104 if (angle > -M_PI_2 && angle <= -M_PI_4)
106 if (angle > -M_PI_4 && angle < 0)
114 const T& endx,
const T& endy)
118 dx = (double)endx - (
double)startx;
119 dy = (double)endy - (
double)starty;
153 template <
class T>
inline void
155 const T& Originaly, T& Transformedx,
160 Transformedx = Originalx;
161 Transformedy = Originaly;
164 Transformedx = Originaly;
165 Transformedy = Originalx;
168 Transformedx = Originaly;
169 Transformedy = -Originalx;
172 Transformedx = -Originalx;
173 Transformedy = Originaly;
176 Transformedx = Originalx * (-1);
177 Transformedy = Originaly * (-1);
180 Transformedx = -Originaly;
181 Transformedy = -Originalx;
184 Transformedx = -Originaly;
185 Transformedy = Originalx;
188 Transformedx = Originalx;
189 Transformedy = -Originaly;
192 BIASERR(
"Invalid LineType, maybe wrong slope in EpipolarLine");
198 template <
class T>
inline void
200 const T& Transformedx,
201 const T& Transformedy,
207 Originalx = Transformedx;
208 Originaly = Transformedy;
211 Originalx = Transformedy;
212 Originaly = Transformedx;
215 Originalx = -Transformedy;
216 Originaly = Transformedx;
219 Originalx = -Transformedx;
220 Originaly = Transformedy;
223 Originalx = Transformedx * (-1);
224 Originaly = Transformedy * (-1);
227 Originalx = -Transformedy;
228 Originaly = -Transformedx;
231 Originalx = Transformedy;
232 Originaly = -Transformedx;
235 Originalx = Transformedx;
236 Originaly = -Transformedy;
239 BIASERR(
"Invalid LineType, maybe wrong slope in EpipolarLine");
244 template <
class T>
inline void
246 const T orig[2], T transf[2])
252 template <
class T>
inline void
254 const T transf[2], T orig[2])
258 transf[1], orig[0], orig[1]);
263 #endif // __8_WAY_SYMMETRY_HH__
void InverseTransform(enum TLineType &type, const T &Transformedx, const T &Transformedy, T &Originalx, T &Originaly)
executes the inverse transformation to the above
enum TLineType DetermineLineType(double &angle)
assumes angle is between (-pi, pi] as given by atan2
class for transforming any point to first octant
void Transform(enum TLineType &type, const T &Originalx, const T &Originaly, T &Transformedx, T &Transformedy)
transforms Original according to type in a way that Transformed lies on a line with slope in [0...
TLineType
direction of line if start is in coordinate origin as given by compass