Go to the documentation of this file.00001 #ifndef vipl_gaussian_convolution_h_
00002 #define vipl_gaussian_convolution_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <vipl/filter/vipl_filter_2d.h>
00028
00029
00030
00031
00032
00033
00034
00035
00036 template <class ImgIn,class ImgOut,class DataIn,class DataOut, VCL_DFL_TYPE_PARAM_STLDECL(PixelItr, vipl_trivial_pixeliter) >
00037 class vipl_gaussian_convolution : public vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>
00038 {
00039
00040 private:
00041 double sigma_;
00042 double& ref_sigma(){return sigma_;}
00043 void put_sigma(double v){sigma_=v;}
00044 double cutoff_;
00045 double& ref_cutoff(){return cutoff_;}
00046 void put_cutoff(double v){cutoff_=v;}
00047 public:
00048 double sigma() const {return sigma_;}
00049 double cutoff() const {return cutoff_;}
00050
00051 private:
00052
00053 double* mask_;
00054 inline double*& ref_mask(){return mask_;}
00055 inline void put_mask(double* v){mask_=v;}
00056 inline double* mask() const{return mask_;}
00057 int masksize_;
00058 inline int& ref_masksize(){return masksize_;}
00059 inline void put_masksize(int v){masksize_=v;}
00060 inline int masksize() const{return masksize_;}
00061
00062
00063 public:
00064 inline vipl_gaussian_convolution(double s=1, double c=0.01)
00065 : vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>()
00066 , sigma_(s)
00067 , cutoff_(c)
00068 , mask_(0)
00069 , masksize_(0)
00070 { if (s < 0) ref_sigma() = -s;
00071 if (c < 0.005) ref_cutoff() = 0.005;
00072 if (c > 0.5) ref_cutoff() = 0.5; }
00073
00074 inline vipl_gaussian_convolution(vipl_gaussian_convolution const& A)
00075 : vipl_filter_2d<ImgIn,ImgOut,DataIn,DataOut,PixelItr>(A)
00076 , sigma_(A.sigma())
00077 , cutoff_(A.cutoff())
00078 , mask_(0)
00079 , masksize_(0) {}
00080
00081 inline ~vipl_gaussian_convolution() {}
00082
00083
00084 bool section_applyop();
00085
00086 bool preop();
00087 bool postop();
00088 };
00089
00090 #ifdef INSTANTIATE_TEMPLATES
00091 #include "vipl_gaussian_convolution.txx"
00092 #endif
00093
00094 #endif // vipl_gaussian_convolution_h_