Go to the documentation of this file.00001 #ifndef rgrl_matcher_k_nearest_h_
00002 #define rgrl_matcher_k_nearest_h_
00003
00004
00005
00006
00007
00008 #include <rgrl/rgrl_matcher.h>
00009 #include <rgrl/rgrl_mask_sptr.h>
00010
00011
00012
00013
00014
00015
00016
00017
00018 class rgrl_matcher_k_nearest
00019 : public rgrl_matcher
00020 {
00021 public:
00022
00023
00024 rgrl_matcher_k_nearest( unsigned int k );
00025
00026
00027
00028
00029
00030
00031
00032 rgrl_matcher_k_nearest( unsigned int k, double dist_thres );
00033
00034 rgrl_match_set_sptr
00035 compute_matches( rgrl_feature_set const& from_features,
00036 rgrl_feature_set const& to_features,
00037 rgrl_view const& current_view,
00038 rgrl_transformation const& current_xform,
00039 rgrl_scale const& ,
00040 rgrl_match_set_sptr const& old_matches = 0 );
00041
00042
00043
00044 rgrl_type_macro( rgrl_matcher_k_nearest, rgrl_matcher);
00045
00046 protected:
00047
00048
00049 bool validate( rgrl_feature_sptr const& mapped, rgrl_mask_sptr const& roi_sptr ) const;
00050
00051
00052 struct internal_dist_node{
00053 double geo_err_;
00054 nodes_vec_iterator itr_;
00055
00056 internal_dist_node(): geo_err_(-1.0){ }
00057
00058 bool operator<( internal_dist_node const& rhs ) const;
00059 };
00060
00061
00062
00063
00064 virtual
00065 void
00066 add_one_flipped_match( rgrl_match_set_sptr& inv_set,
00067 rgrl_view const& current_view,
00068 nodes_vec_iterator const& begin_iter,
00069 nodes_vec_iterator const& end_iter );
00070
00071 protected:
00072 unsigned int k_;
00073 double thres_;
00074 };
00075
00076 #endif // rgrl_matcher_k_nearest_h_