Go to the documentation of this file.00001 #ifndef rgrl_feature_set_h_
00002 #define rgrl_feature_set_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <vcl_vector.h>
00016 #include <vcl_string.h>
00017
00018 #include "rgrl_feature.h"
00019 #include "rgrl_object.h"
00020
00021 class rgrl_feature_set_label;
00022 class rgrl_mask_box;
00023
00024 #include "rgrl_feature_set_sptr.h"
00025
00026
00027
00028
00029
00030
00031
00032
00033 class rgrl_feature_set_label
00034 {
00035 public:
00036
00037 rgrl_feature_set_label( const vcl_string& name = vcl_string() );
00038
00039
00040 vcl_string const& name() const
00041 { return name_; }
00042
00043
00044 bool operator==( rgrl_feature_set_label const& other ) const;
00045
00046
00047 bool operator!=( rgrl_feature_set_label const& other ) const;
00048
00049
00050 bool operator<( rgrl_feature_set_label const& other ) const;
00051
00052 private:
00053 vcl_string name_;
00054 };
00055
00056
00057
00058
00059
00060 class rgrl_feature_set
00061 : public rgrl_object
00062 {
00063 public:
00064 typedef vcl_vector<rgrl_feature_sptr> feature_vector;
00065
00066 public:
00067 rgrl_feature_set( feature_vector const& fea_vec, rgrl_feature_set_label const& label = rgrl_feature_set_label() );
00068
00069 virtual ~rgrl_feature_set();
00070
00071
00072 void set_label( rgrl_feature_set_label const& label )
00073 { label_ = label; }
00074
00075
00076 rgrl_feature_set_label const& label() const
00077 { return label_; }
00078
00079
00080
00081 virtual
00082 feature_vector const&
00083 all_features( ) const
00084 { return fea_vec_; }
00085
00086
00087
00088 virtual
00089 void
00090 features_in_region( feature_vector& results, rgrl_mask_box const& roi ) const = 0;
00091
00092
00093
00094 virtual
00095 void
00096 features_within_radius( feature_vector& results, vnl_vector<double> const& center, double radius ) const = 0;
00097
00098
00099
00100
00101
00102
00103 virtual
00104 rgrl_feature_sptr
00105 nearest_feature( const vnl_vector<double>& loc ) const = 0;
00106
00107
00108 virtual
00109 rgrl_feature_sptr
00110 nearest_feature( rgrl_feature_sptr const& feature ) const = 0;
00111
00112
00113
00114 virtual
00115 void
00116 features_within_radius( feature_vector& results, rgrl_feature_sptr const& feature, double distance ) const = 0;
00117
00118
00119
00120 virtual
00121 void
00122 k_nearest_features( feature_vector& results, const vnl_vector<double>& feature_loc, unsigned int k ) const = 0;
00123
00124
00125
00126 virtual
00127 void
00128 k_nearest_features( feature_vector& results, rgrl_feature_sptr const& feature, unsigned int k ) const = 0;
00129
00130
00131 virtual
00132 rgrl_mask_box
00133 bounding_box() const = 0;
00134
00135
00136 virtual
00137 const vcl_type_info&
00138 type() const = 0;
00139
00140
00141 rgrl_type_macro( rgrl_feature_set, rgrl_object );
00142
00143 private:
00144
00145 rgrl_feature_set( rgrl_feature_set const& other );
00146 rgrl_feature_set& operator=( rgrl_feature_set const& other );
00147
00148 protected:
00149 rgrl_feature_set_label label_;
00150 feature_vector fea_vec_;
00151 };
00152
00153
00154
00155 #endif