18 #ifndef PIC_ALGORITHMS_WEIGHT_FUNCTION_HPP 19 #define PIC_ALGORITHMS_WEIGHT_FUNCTION_HPP 21 #include "../base.hpp" 43 static const double shift = exp(-4);
44 static const double scaleDiv = (1.0 - shift);
45 const double t = x - 0.5;
46 return float((exp(-16.0 * (t * t) ) - shift) / scaleDiv);
51 float val = (2.0f * x - 1.0f);
52 float val_squared = val * val;
53 float val_quartic = val_squared * val_squared;
54 return (1.0f - val_quartic * val_quartic * val_quartic);
59 static const float Zmin = 0.0f;
60 static const float Zmax = 1.0f;
61 static const float tr = (Zmin + Zmax) / 2.0f;
72 static const float Zmin = 0.01f;
73 static const float Zmax = 0.99f;
74 float tr = (Zmin + Zmax) / 2.0f;
77 return CLAMPi(x - Zmin, 0.0f, 1.0f);
79 return CLAMPi(Zmax - x, 0.0f, 1.0f);
Definition: weight_function.hpp:28
Definition: weight_function.hpp:28
Definition: weight_function.hpp:28
#define PIC_INLINE
Definition: base.hpp:33
Definition: weight_function.hpp:28
Definition: weight_function.hpp:28
PIC_INLINE float weightFunction(float x, CRF_WEIGHT type)
weightFunction computes weight functions for x in [0,1].
Definition: weight_function.hpp:36
#define CLAMPi(x, a, b)
Definition: math.hpp:81
Definition: bilateral_separation.hpp:25
CRF_WEIGHT
The CRF_WEIGHT enum.
Definition: weight_function.hpp:28