26 #include "clfGauss.hh"
27 #include <Base/Math/Vector.hh>
28 #include <Base/Common/BIASpragma.hh>
34 template <
class InputStorageType,
class OutputStorageType>
55 template <
class InputStorageType,
class OutputStorageType>
61 template <
class InputStorageType,
class OutputStorageType>
67 template <
class InputStorageType,
class OutputStorageType>
70 SetWinSize(size,
true);
71 CalculateKernels_(GaussSigma_, GaussRatio_);
75 template <
class InputStorageType,
class OutputStorageType>
79 if (LastSigma_ == GaussSigma_ && LastRatio_ == GaussRatio_)
return;
80 LastSigma_ = GaussSigma_;
81 LastRatio_ = GaussRatio_;
83 const int hws = (int)(floor(sqrt(-2.0*Sigma*Sigma*log(Ratio))));
84 const int size = (hws<<1)+1;
93 double fac=1.0/(2.0*Sigma*Sigma);
96 for (i=0; i<=hws; i++){
99 g = expf((
float)(-(
double)(i*i)*fac));
100 V[ip] = V[im] = H[im] = H[ip] = (float)g;
107 for (i=0; i<=hws; i++){
110 H[ip] = H[im] = V[ip] = V[im] = V[im] * (float)sum;
virtual int Filter(clfImage2D *src, clfImage2D *dst)
int FilterSep_(std::string nameX, std::string nameY, clfImage2D *src, clfImage2D *dst)
clf Exception wrapper, is thrown in case of most clf errors
virtual void CalculateKernels_(double Sigma, double Ratio)
calculates the kernel
void AddKernel(std::string kernelname)
adds a kernel to the program.
virtual int Build(unsigned int size)
const std::string & GetMessageString() const
clf error message (usually name of failing c function)
int SetFilter_(unsigned int size, const float *mask)