contrib/mul/mfpf/mfpf_searcher.h
Go to the documentation of this file.
00001 #ifndef mfpf_searcher_h_
00002 #define mfpf_searcher_h_
00003 //:
00004 // \file
00005 // \brief Algorithms to perform global search for multiple matches
00006 // \author Tim Cootes
00007 
00008 #include <mfpf/mfpf_point_finder.h>
00009 #include <mfpf/mfpf_pose_set.h>
00010 #include <vgl/vgl_fwd.h>
00011 
00012 //: Algorithms to perform global search for multiple matches
00013 //  Note that some search algorithms are in mfpf_point_finder
00014 //  itself.
00015 //  More complex algorithms are here, as there are multiple
00016 //  ways of doing things.
00017 class mfpf_searcher
00018 {
00019  private:
00020   //: Radius around point (in model coords) for two poses to be similar
00021   double proximity_r_;
00022 
00023   //: Find list of poses overlapping given pose
00024   void find_overlaps(mfpf_point_finder& pf,
00025                      const vcl_vector<mfpf_pose>& poses,
00026                      const mfpf_pose& pose,
00027                      vcl_vector<unsigned>& overlaps);
00028 
00029   //: If pose not near any poses in list, return false
00030   //  If it is near one, and its fit is better, then replace it.
00031   //  Uses pf.overlap() function to check for proximity
00032   bool find_near_pose(mfpf_point_finder& pf,
00033                       vcl_vector<mfpf_pose>& poses,
00034                       vcl_vector<double>& fits,
00035                       const mfpf_pose& pose, double fit);
00036 
00037  public:
00038   mfpf_searcher();
00039 
00040   void find_refined_matches(mfpf_point_finder& pf,
00041                             const vimt_image_2d_of<float>& image,
00042                             const vgl_point_2d<double>& p,
00043                             const vgl_vector_2d<double>& u,
00044                             vcl_vector<mfpf_pose>& pts,
00045                             vcl_vector<double>& fit);
00046 
00047   //: For each pose in the set, perform local search+refinement
00048   //  On exit pose_set contains the improved matches.
00049   void search_around_set(mfpf_point_finder& pf,
00050                          const vimt_image_2d_of<float>& image,
00051                          mfpf_pose_set& pose_set);
00052 };
00053 
00054 
00055 #endif // mfpf_searcher_h_
00056