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

edge_detector.h

Go to the documentation of this file.
00001 
00040 #ifndef __EDGE_DETECTOR__
00041 #define __EDGE_DETECTOR__
00042 
00043 
00044 #include "base_2D.h"
00045 
00052 namespace Function_2D{
00053 
00054 
00055   /*
00056     #################
00057     # Canny Deriche #
00058     #################
00059   */
00060 
00062   class Canny_Deriche:public Filter_interface_2D{
00063 
00064   public:
00065     inline Canny_Deriche(const real_type center_x = 0,
00066                          const real_type center_y = 0,
00067                          const real_type sigma_x = 1,
00068                          const real_type sigma_y = 1,
00069                          const real_type orientation_angle = 0);
00070 
00071   protected:
00072     virtual inline real_type base_value_proxy(const real_type x,
00073                                               const real_type y) const;
00074 
00075   };
00076 
00077 
00078 
00079   /*
00080     ###############
00081     # Shen Castan #
00082     ###############
00083   */
00084 
00086   class Shen_Castan:public Filter_interface_2D{
00087 
00088   public:
00089     inline Shen_Castan(const real_type center_x = 0,
00090                        const real_type center_y = 0,
00091                        const real_type sigma_x = 1,
00092                        const real_type sigma_y = 1,
00093                        const real_type orientation_angle = 0);
00094 
00095   protected:
00096     virtual inline real_type base_value_proxy(const real_type x,
00097                                               const real_type y) const;
00098 
00099   };
00100 
00101   
00102 /*
00103   ###########################################################
00104   ###########################################################
00105   ###########################################################
00106   ##############                               ##############
00107   ##############  I M P L E M E N T A T I O N  ##############
00108   ##############                               ##############
00109   ###########################################################
00110   ###########################################################
00111   ###########################################################
00112 */
00113 
00114 
00115 /*
00116   #################
00117   # Canny Deriche #
00118   #################
00119 */
00120   Canny_Deriche::
00121   Canny_Deriche(const real_type center_x,
00122                 const real_type center_y,
00123                 const real_type sigma_x,
00124                 const real_type sigma_y,
00125                 const real_type orientation_angle):
00126     Filter_interface_2D(center_x,center_y,
00127                         sigma_x,sigma_y,
00128                         1,1,
00129                         orientation_angle,
00130                         1){}
00131 
00132   Canny_Deriche::real_type
00133   Canny_Deriche::base_value_proxy(const real_type x,
00134                                   const real_type y) const{
00135     
00136     return -x*exp(-fabs(x)-0.5*y*y);
00137   }
00138 
00139 
00140   /*
00141     ###############
00142     # Shen Castan #
00143     ###############
00144   */
00145   
00146   Shen_Castan::Shen_Castan(const real_type center_x,
00147                            const real_type center_y,
00148                            const real_type sigma_x,
00149                            const real_type sigma_y,
00150                            const real_type orientation_angle):
00151     Filter_interface_2D(center_x,center_y,
00152                         sigma_x,sigma_y,
00153                         1,1,
00154                         orientation_angle,
00155                         1){}
00156   
00157   Shen_Castan::real_type
00158   Shen_Castan::base_value_proxy(const real_type x,
00159                                 const real_type y) const{
00160 
00161     const real_type s = (x==0) ? 0 : ((x>0) ? 1 : -1);
00162     
00163     return -s*exp(-fabs(x)-0.5*y*y);
00164   }
00165 }
00166 
00167 #endif
00168 

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