16 #undef CONST_MAX_FLOAT
17 #define CONST_MAX_FLOAT (float)1.0e38
19 #undef CONST_MIN_FLOAT
20 #define CONST_MIN_FLOAT (float)-1.0e38
23 #define CONST_EPSILON (float)0.00000000001
26 #define CONST_E (float)2.7182818284590452354
29 #define CONST_LOG2E (float)1.4426950408889634074
32 #define CONST_LOG10E (float)0.43429448190325182765
35 #define CONST_LN2 (float)0.69314718055994530942
38 #define CONST_LN10 (float)2.30258509299404568402
41 #define CONST_PI (float)3.14159265358979323846
44 #define CONST_2PI (float)6.28318530717958647692
47 #define CONST_PI_2 (float)1.57079632679489661923
50 #define CONST_PI_4 (float)0.78539816339744830962
53 #define CONST_3PI_4 (float)2.35619449019234492885
56 #define CONST_ONE_PI (float)0.31830988618379067154
59 #define CONST_TWO_PI (float)0.63661977236758134308
61 #undef CONST_TWO_SQRTPI
62 #define CONST_TWO_SQRTPI (float)1.12837916709551257390
65 #define CONST_180_PI (float)57.2957795130823208768
68 #define CONST_SQRT2 (float)1.41421356237309504880
71 #define CONST_SQRT1_2 (float)0.70710678118654752440
73 #undef CONST_SQRT3OVER2
74 #define CONST_SQRT3OVER2 (float)0.86602540378443864676
77 #define CONST_3PI_2 (float)4.71238898038468985769
80 #define CONST_PI_8 (float)0.39269908169872415480
83 #define CONST_3PI_8 (float)1.17809724509617246442
86 #define CONST_5PI_8 (float)1.96349540849362077403
89 #define CONST_7PI_8 (float)2.74889357189106908365
96 #define BYTE unsigned char
99 #define SQR(x) ((x)*(x))
102 #define IS_ODD(x) ((x) % 2)
105 #define IS_EVEN(x) (!IS_ODD(x))
108 #define ODDIFY(x) if (IS_EVEN(x)) x++
111 #define F2I(x) ((x > 0.0f) ? (int)(x+0.5f) : (int)(x-0.5f))
114 #define APPXEQL(x,y,e) (fabs((x)-(y)) <= e)
117 #define SGN(x) (((x) > 0) ? 1 : (((x) == 0) ? 0 : -1))
120 #define SAME_SGN(x, y) (((x) > 0) ? ((y) > 0) : (y <= 0))
123 #define MAX(a,b) ((a) > (b) ? (a) : (b))
126 #define MIN(a,b) ((a) < (b) ? (a) : (b))
129 #define ABS(x) ((x) < 0 ? -(x) : (x))
137 #define zap(x) do { if (x) { delete(x); x = 0; } } while (0)
141 #define IS_A_FLOAT(x) ((x >= CONST_MIN_FLOAT) && (x <= CONST_MAX_FLOAT))
162 double AngleSum(
double a1,
double a2);
172 float BiGauss(
float mu1,
float mu2,
float mu12,
173 float sigma1,
float sigma2,
float sigma12,
188 float Max(
float* pBuf,
int Size);
190 int Max(
int* pBuf,
int Size);
195 float Min(
float* pBuf,
int Size);
198 int iMin(
float* pBuf,
int Size);
204 double logbase(
const double base,
const double argument);
214 void FloatToInt(
const float& Xfloat,
int& Xint,
215 const float& MinRange,
const float& MaxRange,
216 const int& Resolution);
218 void IntToFloat(
const int& Xint,
float& Xfloat,
219 const float& MinRange,
const float& MaxRange,
220 const int& Resolution);
232 const float& x1,
const float&
y1,
233 const float& x2,
const float&
y2);
247 float& InterpolatedThetaResult);
255 const float& x1,
const float& y1,
256 const float& x2,
const float& y2,
257 float& a,
float& b,
float& c);
264 void FixThetaRange(
float& Theta,
const bool& bHalfPhase =
true);
268 inline void Swap(T& p1, T& p2) {
275 inline T
SSD(
const T& x1,
const T& y1,
const T& x2,
const T& y2) {
T SSD(const T &x1, const T &y1, const T &x2, const T &y2)
Definition: utils.h:275
float Max(float *pBuf, int Size)
Definition: utils.cpp:90
void FloatToInt(const float &Xfloat, int &Xint, const float &MinRange, const float &MaxRange, const int &Resolution)
Definition: utils.cpp:150
y2
Definition: APPgetLargeConnectedEdges.m:125
int NextPowerOfTwo(const int x)
Definition: utils.cpp:138
void FixThetaRange(float &Theta, const bool &bHalfPhase=true)
Definition: utils.cpp:261
float FuzzySigmoid(float g, float a, float b, float c)
Definition: utils.cpp:78
int iMin(float *pBuf, int Size)
Definition: utils.cpp:116
void IntToFloat(const int &Xint, float &Xfloat, const float &MinRange, const float &MaxRange, const int &Resolution)
Definition: utils.cpp:160
void ParabolicOrientationInterpolation(const float &Theta1, const float &Rho1, const float &Theta2, const float &Rho2, const float &Theta3, const float &Rho3, float &InterpolatedThetaResult)
Definition: utils.cpp:180
float BiGauss(float mu1, float mu2, float mu12, float sigma1, float sigma2, float sigma12, float x1, float x2)
Definition: utils.cpp:59
double AngleDiff(double a1, double a2)
Definition: utils.cpp:19
x1
Definition: APPgetLargeConnectedEdges.m:122
float ParabolicInverseInterpolation(const float &x0, const float &y0, const float &x1, const float &y1, const float &x2, const float &y2)
Definition: utils.cpp:222
bool IsAccute(const float &Theta)
Definition: utils.cpp:172
double AngleSum(double a1, double a2)
Definition: utils.cpp:39
x
Definition: APPgetLargeConnectedEdges.m:100
y1
Definition: APPgetLargeConnectedEdges.m:124
x2
Definition: APPgetLargeConnectedEdges.m:123
void ParabolicInterpolation(const float &x0, const float &y0, const float &x1, const float &y1, const float &x2, const float &y2, float &a, float &b, float &c)
Definition: utils.cpp:245
void Swap(T &p1, T &p2)
Definition: utils.h:268
double logbase(const double base, const double argument)
Definition: utils.cpp:130
#define SQR(x)
Definition: utils.h:99
float Min(float *pBuf, int Size)
Definition: utils.cpp:107