00001 #ifndef _ABFILTER_H_
00002 #define _ABFILTER_H_
00003
00004 #include "recfilter.h"
00005 #include "gabor.h"
00006 #include "cell.h"
00007
00008 typedef struct
00009 {
00010 int id;
00011 CImg<double> filter;
00012 CImg<double> *convFFTRes;
00013 double convValue;
00014 }SpatFilterInfo;
00015 typedef map< int, SpatFilterInfo > SpatialFilterList;
00016
00017 typedef struct
00018 {
00019 Cell filter;
00020 double weight;
00021 SpatFilterInfo *spatFilterPtr;
00022 } FilterInfo;
00023 typedef vector< FilterInfo > FilterGroup;
00024
00025
00026 class ABFilter: public RecFilter
00027 {
00071 private:
00072
00073 double davalue;
00074 double spatialFrequency;
00075 double tauFilter;
00076 double angle;
00077 double orientation;
00078 double ampFactor;
00079 double step;
00080 SpatialFilterList spatFilterList;
00081 int spatFilterIndex;
00082 int nGroups;
00083 FilterGroup *fGroup;
00084 CImg<double> oddSpat;
00085 CImg<double> evenSpat;
00086
00087 void buildSpatialFilter(void);
00088 void setValue(double);
00089 double getValue();
00090 void set_nGroups(int nG);
00091 void addFilterToGroup(Cell flt, double w, int group, int spatFltId = -1);
00092
00093 int addSpatFilterToList( CImg<double> *inFilt);
00094 void allocateValues();
00095
00096 #ifdef FFT_FILTERING
00097 COMPLEX_IMAG fftOddSpat;
00098 COMPLEX_IMAG fftEvenSpat;
00099 CImg<double> oddConvResult;
00100 CImg<double> evenConvResult;
00101 #endif // FFT_FILTERING
00102
00103 public:
00104 ABFilter(void);
00105 ~ABFilter(void);
00106
00107
00116 void set_spatialOrient(double angle);
00117
00118
00119
00125 void set_temporalFrequency(double omega);
00126
00127
00128
00134 void set_spatialFrequency(double xi);
00135
00136
00137
00146 void set_step(double step);
00147
00148
00149
00159 double convolve(CImg<double> &image, double centerx, double centery);
00160
00161
00162
00168 void filter_build();
00169
00170
00171 };
00172
00173 #endif // _ABFILTER_H_