00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef IMG_ALG_FILTER_FOURIER_FILTERS_H
00027 #define IMG_ALG_FILTER_FOURIER_FILTERS_H
00028
00029 #include <ost/img/algorithm.hh>
00030 #include <ost/img/image_state.hh>
00031 #include <ost/img/image_state.hh>
00032
00033 namespace ost { namespace img { namespace alg {
00034
00036
00037 class DLLEXPORT_IMG_ALG LowPassFilter : public ConstModIPAlgorithm
00038 {
00039 public:
00040
00041 LowPassFilter(Real limit=1.0):
00042 ConstModIPAlgorithm("LowPassFilter"),
00043 limit_(1.0/limit)
00044 {if(limit_==0.0)throw("Invalid limit");}
00045
00046 virtual void Visit(ImageHandle& ih) const ;
00047
00048 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00049 Real GetLimit() {return 1.0/limit_;}
00050
00051 private:
00052
00053 Real limit_;
00054 };
00055
00057
00058 class DLLEXPORT_IMG_ALG HighPassFilter : public ConstModIPAlgorithm
00059 {
00060 public:
00061
00062 HighPassFilter(Real limit=1.0):
00063 ConstModIPAlgorithm("HighPassFilter"),
00064 limit_(1.0/limit)
00065 {if(limit_==0.0)throw("Invalid limit");}
00066
00067 virtual void Visit(ImageHandle& ih) const ;
00068
00069 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00070 Real GetLimit() {return 1.0/limit_;}
00071
00072 private:
00073
00074 Real limit_;
00075 };
00076
00078
00079
00080 class DLLEXPORT_IMG_ALG GaussianLowPassFilter : public ConstModIPAlgorithm
00081 {
00082 public:
00083
00084 GaussianLowPassFilter(Real limit=1.0):
00085 ConstModIPAlgorithm("GaussianLowPassFilter"),
00086 limit_(1.0/limit)
00087 {if(limit_==0.0)throw("Invalid limit");}
00088
00089 virtual void Visit(ImageHandle& ih) const ;
00090
00091 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00092 Real GetLimit() {return 1.0/limit_;}
00093
00094 private:
00095
00096 Real limit_;
00097 };
00098
00100
00101 class DLLEXPORT_IMG_ALG GaussianHighPassFilter : public ConstModIPAlgorithm
00102 {
00103 public:
00104
00105 GaussianHighPassFilter(Real limit=1.0):
00106 ConstModIPAlgorithm("GaussianHighPassFilter"),
00107 limit_(1.0/limit)
00108 {if(limit_==0.0)throw("Invalid limit");}
00109
00110 virtual void Visit(ImageHandle& ih) const ;
00111
00112 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00113 Real GetLimit() {return 1.0/limit_;}
00114
00115 private:
00116
00117 Real limit_;
00118 };
00119
00120
00122
00124 class DLLEXPORT_IMG_ALG FermiLowPassFilter : public ConstModIPAlgorithm
00125 {
00126 public:
00127
00128 FermiLowPassFilter(Real limit=1.0, Real t=1.0):
00129 ConstModIPAlgorithm("FermiLowPassFilter"),
00130 limit_(1.0/limit),
00131 t_(1.0/t)
00132 {if(limit_==0.0)throw("Invalid limit");if(t_==0.0)throw("Invalid t");}
00133
00134 virtual void Visit(ImageHandle& ih) const ;
00135
00136 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00137 Real GetLimit() {return 1.0/limit_;}
00138
00139 void SetT(Real t) {if(t_==0.0)throw("Invalid t");t_=1.0/t;}
00140 Real GetT() {return 1.0/t_;}
00141
00142 private:
00143
00144 Real limit_;
00145 Real t_;
00146 };
00147
00149
00151 class DLLEXPORT_IMG_ALG FermiHighPassFilter : public ConstModIPAlgorithm
00152 {
00153 public:
00154
00155 FermiHighPassFilter(Real limit=1.0, Real t=1.0):
00156 ConstModIPAlgorithm("FermiLowPassFilter"),
00157 limit_(1.0/limit),
00158 t_(-1.0/t)
00159 {if(limit_==0.0)throw("Invalid limit");if(t_==0.0)throw("Invalid t");}
00160
00161 virtual void Visit(ImageHandle& ih) const ;
00162
00163 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00164 Real GetLimit() {return 1.0/limit_;}
00165
00166 void SetT(Real t) {if(t_==0.0)throw("Invalid t");t_=-1.0/t;}
00167 Real GetT() {return -1.0/t_;}
00168
00169 private:
00170
00171 Real limit_;
00172 Real t_;
00173 };
00174
00176
00178 class DLLEXPORT_IMG_ALG ButterworthLowPassFilter : public ConstModIPAlgorithm
00179 {
00180 public:
00181
00182 ButterworthLowPassFilter(Real limit=1.0,Real stop=1.0):
00183 ConstModIPAlgorithm("ButterworthLowPassFilter"),
00184 limit_(1.0/limit),
00185 stop_(1.0/stop),
00186 eps_(0.882),
00187 a_(10.624)
00188 {if(limit_==0.0)throw("Invalid limit");if(stop==0.0)throw("Invalid stop");}
00189
00190 virtual void Visit(ImageHandle& ih) const ;
00191
00192 void SetLimit(Real limit) {if(limit_==0.0)throw("Invalid limit");limit_=1.0/limit;}
00193 Real GetLimit() {return 1.0/limit_;}
00194
00195 void SetStop(Real stop) {if(stop==0.0)throw("Invalid stop");stop_=1.0/stop;}
00196 Real GetStop() {return 1.0/stop_;}
00197
00198 void SetEps(Real eps) {eps_=eps;}
00199 Real GetEps() {return eps_;}
00200
00201 void SetA(Real a) {a_=a;}
00202 Real GetA() {return a_;}
00203
00204 private:
00205
00206 Real limit_;
00207 Real stop_;
00208 Real eps_;
00209 Real a_;
00210 };
00211
00213
00215 class DLLEXPORT_IMG_ALG ButterworthHighPassFilter : public ButterworthLowPassFilter
00216 {
00217 public:
00218 ButterworthHighPassFilter(Real limit=1.0,Real stop=1.0):
00219 ButterworthLowPassFilter(limit,stop){}
00220
00221 };
00222
00223 }}}
00224
00225 #endif // IPLT_ALG_FILTER_FOURIER_FILTERS_H
00226