Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

gabor.h

Go to the documentation of this file.
00001 
00040 #ifndef __GABOR__
00041 #define __GABOR__
00042 
00043 #include "base_2D.h"
00044 #include "gaussian_2D.h"
00045 
00046 namespace Function_2D{
00047 
00049   class Gabor:public Filter_interface_2D{
00050 
00051   public:
00052     Gabor::Gabor(const real_type center_x = 0,
00053                  const real_type center_y = 0,
00054                  const real_type sigma_x = 1,
00055                  const real_type sigma_y = 1,
00056                  const real_type orientation_angle = 0,
00057                  const real_type w_phase = 0,
00058                  const real_type w_length = 1);
00059 
00060     inline void set_phase(const real_type p);
00061     inline void set_wave_length(const real_type w);
00062 
00063   protected:
00064 
00066     real_type phase;
00067 
00070     real_type wave_length;
00071 
00072     
00073     virtual inline real_type base_value_proxy(const real_type x,
00074                                               const real_type y) const;
00075 
00076 
00077   };
00078 
00079 
00080 
00081   /*
00082     ###########################################################
00083     ###########################################################
00084     ###########################################################
00085     ##############                               ##############
00086     ##############  I M P L E M E N T A T I O N  ##############
00087     ##############                               ##############
00088     ###########################################################
00089     ###########################################################
00090     ###########################################################
00091   */
00092 
00093   Gabor::Gabor(const real_type center_x,
00094                const real_type center_y,
00095                const real_type sigma_x,
00096                const real_type sigma_y,
00097                const real_type orientation_angle,
00098                const real_type w_phase,
00099                const real_type w_length):
00100     Filter_interface_2D(center_x,center_y,
00101                         sigma_x,sigma_y,
00102                         M_SQRT1_2,M_SQRT1_2,
00103                         orientation_angle,
00104                         0.5/M_PI),
00105     phase(w_phase),
00106     wave_length(w_length){}
00107   
00108   void Gabor::set_phase(const real_type p){
00109     phase = p;
00110   }
00111 
00112   void Gabor::set_wave_length(const real_type w){
00113     wave_length = w;
00114   }
00115 
00116   Gabor::real_type
00117   Gabor::base_value_proxy(const real_type x,
00118                           const real_type y) const{
00119 
00120     return cos(2*M_PI*x/wave_length + phase) * Gaussian::base_value(x,y);
00121   }
00122   
00123 }
00124 
00125 #endif

Generated on Fri Aug 20 12:08:01 2004 by doxygen1.2.18