Go to the documentation of this file.00001 #ifndef mfpf_grad_corr2d_h_
00002 #define mfpf_grad_corr2d_h_
00003
00004
00005
00006
00007
00008 #include <mfpf/mfpf_point_finder.h>
00009 #include <vgl/vgl_fwd.h>
00010 #include <vcl_iosfwd.h>
00011
00012
00013 class mfpf_grad_corr2d : public mfpf_point_finder
00014 {
00015 private:
00016
00017 double ref_x_;
00018
00019 double ref_y_;
00020
00021
00022
00023 double overlap_f_;
00024
00025
00026 vil_image_view<double> kernel_x_;
00027
00028
00029 vil_image_view<double> kernel_y_;
00030
00031
00032 void set_defaults();
00033
00034
00035 void diff_image(const vimt_image_2d_of<float>& image,
00036 const vgl_point_2d<double>& p,
00037 const vgl_vector_2d<double>& u,
00038 vil_image_view<double>& grad_x,
00039 vil_image_view<double>& grad_y,
00040 int search_ni=0, int search_nj=0);
00041
00042 public:
00043
00044
00045 mfpf_grad_corr2d();
00046
00047
00048 virtual ~mfpf_grad_corr2d();
00049
00050
00051
00052 void set(const vil_image_view<double>& kx, const vil_image_view<double>& ky);
00053
00054
00055 void set(const vil_image_view<double>& kx, const vil_image_view<double>& ky,
00056 double ref_x, double ref_y);
00057
00058
00059 virtual bool set_model(const vcl_vector<double>& v);
00060
00061
00062 virtual unsigned model_dim();
00063
00064
00065
00066 void set_overlap_f(double);
00067
00068
00069 const vil_image_view<double>& kernel_x() const { return kernel_x_; }
00070
00071
00072 const vil_image_view<double>& kernel_y() const { return kernel_y_; }
00073
00074
00075 void get_kernel_vector(vcl_vector<double>& v) const;
00076
00077
00078 virtual void get_sample_vector(const vimt_image_2d_of<float>& image,
00079 const vgl_point_2d<double>& p,
00080 const vgl_vector_2d<double>& u,
00081 vcl_vector<double>& v);
00082
00083
00084 virtual double radius() const;
00085
00086
00087
00088 virtual double evaluate(const vimt_image_2d_of<float>& image,
00089 const vgl_point_2d<double>& p,
00090 const vgl_vector_2d<double>& u);
00091
00092
00093
00094
00095
00096
00097
00098
00099 virtual void evaluate_region(const vimt_image_2d_of<float>& image,
00100 const vgl_point_2d<double>& p,
00101 const vgl_vector_2d<double>& u,
00102 vimt_image_2d_of<double>& response);
00103
00104
00105
00106
00107
00108 virtual double search_one_pose(const vimt_image_2d_of<float>& image,
00109 const vgl_point_2d<double>& p,
00110 const vgl_vector_2d<double>& u,
00111 vgl_point_2d<double>& new_p);
00112
00113
00114
00115
00116 bool is_inside(const mfpf_pose& pose,
00117 const vgl_point_2d<double>& p,
00118 double f=1.0) const;
00119
00120
00121
00122 virtual bool overlap(const mfpf_pose& pose1,
00123 const mfpf_pose& pose2) const;
00124
00125
00126
00127
00128 virtual void get_outline(vcl_vector<vgl_point_2d<double> >& pts) const;
00129
00130
00131 virtual void get_image_of_model(vimt_image_2d_of<vxl_byte>& image) const;
00132
00133
00134 short version_no() const;
00135
00136
00137 virtual vcl_string is_a() const;
00138
00139
00140 virtual mfpf_point_finder* clone() const;
00141
00142
00143 virtual void print_summary(vcl_ostream& os) const;
00144
00145
00146 virtual void b_write(vsl_b_ostream& bfs) const;
00147
00148
00149 virtual void b_read(vsl_b_istream& bfs);
00150
00151
00152 bool operator==(const mfpf_grad_corr2d& nc) const;
00153 };
00154
00155 #endif