00001 #ifndef mfpf_max_finder_h_ 00002 #define mfpf_max_finder_h_ 00003 00004 //: 00005 // \file 00006 // \brief Locates largest value along a profile 00007 // \author Tim Cootes 00008 00009 #include <mfpf/mfpf_point_finder.h> 00010 #include <vgl/vgl_fwd.h> 00011 #include <vcl_iosfwd.h> 00012 00013 //: Locates largest value along a profile. 00014 class mfpf_max_finder : public mfpf_point_finder 00015 { 00016 public: 00017 00018 //: Dflt ctor 00019 mfpf_max_finder(); 00020 00021 //: Destructor 00022 virtual ~mfpf_max_finder(); 00023 00024 //: Radius of circle containing modelled region 00025 virtual double radius() const; 00026 00027 //: Evaluate match at p, using u to define scale and orientation 00028 // Returns -1*value at p 00029 virtual double evaluate(const vimt_image_2d_of<float>& image, 00030 const vgl_point_2d<double>& p, 00031 const vgl_vector_2d<double>& u); 00032 00033 //: Evaluate match at in a region around p 00034 // Returns a quality of fit at a set of positions. 00035 // response image (whose size and transform is set inside the 00036 // function), indicates the points at which the function was 00037 // evaluated. response(i,j) is the fit at the point 00038 // response.world2im().inverse()(i,j). The world2im() transformation 00039 // may be affine. 00040 virtual void evaluate_region(const vimt_image_2d_of<float>& image, 00041 const vgl_point_2d<double>& p, 00042 const vgl_vector_2d<double>& u, 00043 vimt_image_2d_of<double>& response); 00044 00045 //: Search given image around p, using u to define scale and orientation 00046 // On exit, new_p and new_u define position, scale and orientation of 00047 // the best nearby match. Returns a quality of fit measure at that 00048 // point (the smaller the better). 00049 virtual double search_one_pose(const vimt_image_2d_of<float>& image, 00050 const vgl_point_2d<double>& p, 00051 const vgl_vector_2d<double>& u, 00052 vgl_point_2d<double>& new_p); 00053 00054 //: Generate points in ref frame that represent boundary 00055 // Points of a closed contour around the shape. 00056 // Used for display purposes. 00057 virtual void get_outline(vcl_vector<vgl_point_2d<double> >& pts) const; 00058 00059 //: Name of the class 00060 virtual vcl_string is_a() const; 00061 00062 //: Create a copy on the heap and return base class pointer 00063 virtual mfpf_point_finder* clone() const; 00064 00065 //: Print class to os 00066 virtual void print_summary(vcl_ostream& os) const; 00067 00068 //: Version number for I/O 00069 short version_no() const; 00070 00071 //: Save class to binary file stream 00072 virtual void b_write(vsl_b_ostream& bfs) const; 00073 00074 //: Load class from binary file stream 00075 virtual void b_read(vsl_b_istream& bfs); 00076 }; 00077 00078 #endif