Go to the documentation of this file.00001
00002 #ifndef sdet_nonmax_suppression_h_
00003 #define sdet_nonmax_suppression_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
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #include <vcl_vector.h>
00044 #include <vsol/vsol_point_2d_sptr.h>
00045 #include <vsol/vsol_line_2d_sptr.h>
00046 #include <sdet/sdet_nonmax_suppression_params.h>
00047 #include <vgl/vgl_vector_2d.h>
00048 #include <vil/vil_image_view.h>
00049 #include <vbl/vbl_array_2d.h>
00050 #include <vgl/vgl_homg_line_2d.h>
00051
00052 class sdet_nonmax_suppression : public sdet_nonmax_suppression_params
00053 {
00054 public:
00055
00056 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00057 vbl_array_2d<double> &grad_x,
00058 vbl_array_2d<double> &grad_y);
00059
00060 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00061 vbl_array_2d<double> &dir_x,
00062 vbl_array_2d<double> &dir_y,
00063 vbl_array_2d<double> &grad_mag);
00064
00065 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00066 vbl_array_2d<double> &grad_mag,
00067 vbl_array_2d<vgl_vector_2d <double> > &directions);
00068
00069 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00070 vil_image_view<double> &grad_x,
00071 vil_image_view<double> &grad_y);
00072
00073 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00074 vil_image_view<double> &dir_x,
00075 vil_image_view<double> &dir_y,
00076 vil_image_view<double> &grad_mag);
00077
00078 sdet_nonmax_suppression(sdet_nonmax_suppression_params& nsp,
00079 vil_image_view<double> &grad_mag,
00080 vbl_array_2d<vgl_vector_2d <double> > &directions);
00081
00082 ~sdet_nonmax_suppression();
00083
00084 vcl_vector<vsol_point_2d_sptr>& get_points(){return points_;}
00085 vcl_vector<vsol_line_2d_sptr>& get_lines(){return lines_;}
00086 vcl_vector<vgl_vector_2d<double> >& get_directions() {return directions_;}
00087
00088 void apply();
00089 void clear();
00090
00091 protected:
00092
00093 bool points_valid_;
00094 vcl_vector<vsol_point_2d_sptr> points_;
00095 vcl_vector<vsol_line_2d_sptr> lines_;
00096 vcl_vector<vgl_vector_2d<double> > directions_;
00097 vbl_array_2d<double> grad_x_;
00098 vbl_array_2d<double> grad_y_;
00099 vbl_array_2d<double> grad_mag_;
00100 int width_, height_;
00101 double max_grad_mag_;
00102 int parabola_fit_type_;
00103
00104 int intersected_face_number(double gx, double gy);
00105 double intersection_parameter(double gx, double gy, int face_num);
00106 void f_values(int x, int y, double gx, double gy, double s, int face_num, double *f);
00107
00108 void get_relative_corner_coordinates(int face_num, int *corners);
00109
00110 double subpixel_s(double *s, double *f);
00111
00112 double subpixel_s(int x, int y, vgl_vector_2d<double> direction);
00113 void find_distance_s_and_f_for_point(int x, int y, vgl_homg_line_2d<double> line,
00114 double &d, double &s, vgl_vector_2d<double> direction);
00115 };
00116
00117 #endif // sdet_nonmax_suppression_h_