1 #ifndef MATH_FUNCTIONS_H_ 2 #define MATH_FUNCTIONS_H_ 9 namespace til {
namespace math {
20 template <
typename T >
33 template <
typename T >
46 template <
typename T >
59 template <
typename TPrec >
61 :
public std::unary_function<TPrec, TPrec>
80 inline void setSigma(prec_type sigma);
107 template <
typename TArray,
typename TPrec >
109 :
public std::binary_function<const TArray &, const TArray &, TPrec>
117 void setSigma(prec_type sigma) { m_gaussian.setSigma(sigma); }
118 prec_type
getSigma()
const {
return m_gaussian.getSigma(); }
120 prec_type
operator()(
const TArray & x,
const TArray & y)
const Gaussian(prec_type sigma)
Constructor with Gaussian standard deviation.
T d_huber(T x, T K)
Derivative of Huber's penalty function.
void sqrt(const TImage &in, TImage &out)
T huber(T x, T K)
Huber's penalty function.
Belongs to package Box Do not include directly, include til/Box.h instead.
prec_type getSigma() const
void setSigma(prec_type sigma)
Unnormalized isotropic Gaussian kernel.
T shrink(T x, T K)
The shrink operator if |x| > K then x +/- K else 0.
prec_type getSigma() const
prec_type squared_input(prec_type x2) const
Return the value of the Gaussian kernel at x, the input being x^2.
prec_type operator()(prec_type x) const
Return the value of the Gaussian kernel at x.
prec_type operator()(const TArray &x, const TArray &y) const
void setSigma(prec_type sigma)
IsotropicGaussianKernel(prec_type sigma)
A dummy class used to pass a precision type for computations to some functions.
TPrec dist2(const numeric_array< T1, D > &v1, const numeric_array< T2, D > &v2, prec< TPrec >)
Return the squared Euclidean distance between two vectors, computed with a precision given as the fir...