Go to the documentation of this file.00001 #ifndef mfpf_mr_point_finder_h_
00002 #define mfpf_mr_point_finder_h_
00003
00004
00005
00006
00007
00008 #include <mbl/mbl_cloneable_ptr.h>
00009 #include <mfpf/mfpf_point_finder.h>
00010 #include <vcl_cassert.h>
00011 #include <vcl_iosfwd.h>
00012
00013 class vimt_image_pyramid;
00014
00015
00016
00017
00018 class mfpf_mr_point_finder
00019 {
00020 protected:
00021
00022
00023 vcl_vector<mbl_cloneable_ptr<mfpf_point_finder> > finders_;
00024
00025
00026
00027 unsigned max_after_pruning_;
00028
00029 public:
00030
00031
00032 mfpf_mr_point_finder();
00033
00034
00035 virtual ~mfpf_mr_point_finder();
00036
00037
00038 unsigned size() const { return finders_.size(); }
00039
00040
00041 const mfpf_point_finder& finder(unsigned L) const
00042 { assert (L<finders_.size()); return *finders_[L]; }
00043
00044
00045 mfpf_point_finder& finder(unsigned L)
00046 { assert (L<finders_.size()); return *finders_[L]; }
00047
00048
00049 void set(const vcl_vector<mfpf_point_finder*>& finders);
00050
00051
00052
00053
00054 unsigned max_after_pruning() const { return max_after_pruning_; }
00055
00056
00057
00058 void set_max_after_pruning(unsigned max_n);
00059
00060
00061
00062
00063
00064 unsigned image_level(unsigned i, const mfpf_pose& pose,
00065 const vimt_image_pyramid& im_pyr) const;
00066
00067
00068 void get_sample_vector(const vimt_image_pyramid& image_pyr,
00069 const vgl_point_2d<double>& p,
00070 const vgl_vector_2d<double>& u,
00071 unsigned L,
00072 vcl_vector<double>& v);
00073
00074
00075
00076
00077
00078
00079
00080 double search(const vimt_image_pyramid& im_pyr,
00081 const mfpf_pose& pose0,
00082 mfpf_pose& best_pose);
00083
00084
00085
00086
00087
00088 double mr_search(const vimt_image_pyramid& im_pyr,
00089 mfpf_pose& pose, int L_lo, int L_hi);
00090
00091
00092
00093 void refine_match(const vimt_image_pyramid& im_pyr,
00094 mfpf_pose& pose, double& fit, unsigned L=0);
00095
00096
00097
00098
00099
00100
00101
00102
00103 void multi_search(const vimt_image_pyramid& im_pyr,
00104 const mfpf_pose& pose0,
00105 vcl_vector<mfpf_pose>& poses,
00106 vcl_vector<double>& fits);
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 void multi_search_and_prune(const vimt_image_pyramid& im_pyr,
00120 const mfpf_pose& pose0,
00121 vcl_vector<mfpf_pose>& poses,
00122 vcl_vector<double>& fits,
00123 int prune_level=-1);
00124
00125
00126
00127 void save_images_of_models(const vcl_string& basepath) const;
00128
00129
00130 short version_no() const;
00131
00132
00133 virtual vcl_string is_a() const;
00134
00135
00136 virtual void print_summary(vcl_ostream& os) const;
00137
00138
00139 virtual void b_write(vsl_b_ostream& bfs) const;
00140
00141
00142 virtual void b_read(vsl_b_istream& bfs);
00143 };
00144
00145
00146 vcl_ostream& operator<<(vcl_ostream& os,const mfpf_mr_point_finder& b);
00147
00148
00149 void vsl_b_write(vsl_b_ostream& bfs, const mfpf_mr_point_finder& b);
00150
00151
00152 void vsl_b_read(vsl_b_istream& bfs, mfpf_mr_point_finder& b);
00153
00154 #endif // mfpf_mr_point_finder_h_