28 #include <Base/Common/BIASpragmaStart.hh>
29 #include <Base/Image/Image.hh>
30 #include <OpenCLFramework/clfOpenCL.hh>
31 #include <OpenCLFramework/clfContext.hh>
32 #include <OpenCLFramework/Filter/clfFilter.hh>
36 template <
class InputStorageType,
class OutputStorageType>
37 class BIASOpenCLFramework_EXPORT
clfGauss :
public clfFilter<InputStorageType, OutputStorageType> {
44 virtual int Build(
unsigned int size);
49 CalculateKernels_(GaussSigma_, GaussRatio_);
52 inline double GetSigma()
const {
return GaussSigma_; }
56 CalculateKernels_(GaussSigma_, GaussRatio_);
59 inline double GetRatio()
const {
return GaussRatio_; }
64 inline void SetWinSize(
const int ws,
bool AdjustSigma=
true)
68 GaussSigma_ = sqrt((
double)hws*(
double)hws/(-2.0*log(GaussRatio_)));
70 GaussRatio_ = 0.5*(exp(((
double)hws*(
double)hws)
71 /(-2.0*(GaussSigma_)*(GaussSigma_)))+
72 exp(((
double)(hws+1.0)*(
double)(hws+1.0))
73 /(-2.0*(GaussSigma_)*(GaussSigma_)))) ;
86 virtual void CalculateKernels_(
double Sigma,
double Ratio);
102 #include <Base/Common/BIASpragmaEnd.hh>
void SetRatio(const double ratio)
void SetSigma(const double si)
void SetWinSize(const int ws, bool AdjustSigma=true)
define the half win size of the kernel, if AdjustSigma is true sigma is computed according to the cut...