Go to the documentation of this file.00001
00002 #ifndef osl_canny_base_h_
00003 #define osl_canny_base_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <osl/osl_canny_port.h>
00031
00032 template <class T>
00033 T **osl_canny_base_make_raw_image(int, int, T *dummy);
00034 template <class T>
00035 void osl_canny_base_fill_raw_image(T **, int, int, T value);
00036 template <class T>
00037 void osl_canny_base_free_raw_image(T **);
00038 template <class S, class T>
00039 void osl_canny_base_copy_raw_image(S const * const *src, T * const *dst, int, int);
00040
00041 class osl_canny_base {
00042 public:
00043 osl_canny_base(float sigma, float low, float high, bool verbose = true);
00044 ~osl_canny_base();
00045
00046 protected:
00047
00048 static void Initial_follow(float * const *thin, int xsize, int ysize, float low,
00049 int x,int y,
00050 vcl_list<int> *xc,vcl_list<int> *yc,
00051 vcl_list<float> *grad);
00052 void Final_follow(int,int,vcl_list<int>*,vcl_list<int>*,vcl_list<float>*,int);
00053 static void Follow_junctions(int * const *junction, int x, int y, vcl_list<int> *xc, vcl_list<int> *yc);
00054 static void Cluster_centre_of_gravity(int * const *jx, int * const *jy,
00055 vcl_list<int> &xc, vcl_list<int> &yc,
00056 int &x0,int &y0);
00057 static int Junction_neighbour(int const * const *junction, int x, int y);
00058
00059
00060 unsigned int xstart_,ystart_;
00061 unsigned int xsize_,ysize_;
00062
00063 float **smooth_;
00064 float **dx_;
00065 float **dy_;
00066 float **grad_;
00067
00068 float **thick_;
00069 float **thin_;
00070 float **theta_;
00071
00072
00073 int **junction_;
00074 int **jx_,**jy_;
00075 vcl_list<int> *xjunc_;
00076 vcl_list<int> *yjunc_;
00077 vcl_list<osl_Vertex*> *vlist_;
00078
00079 float gauss_tail_;
00080 float sigma_;
00081 int width_;
00082 int w0_;
00083 int k_size_;
00084 float *kernel_;
00085 float low_;
00086 float high_;
00087
00088 float jval_;
00089 int chain_no_;
00090 bool verbose;
00091 };
00092
00093 #endif // osl_canny_base_h_