Go to the documentation of this file.00001 #ifndef rgrl_feature_set_bins_h_
00002 #define rgrl_feature_set_bins_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <rsdl/rsdl_fwd.h>
00015 #include <rgrl/rgrl_feature_set.h>
00016 #include <rgrl/rgrl_mask.h>
00017
00018 #include <vcl_memory.h>
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 template<unsigned N>
00045 class rgrl_feature_set_bins
00046 : public rgrl_feature_set
00047 {
00048 public:
00049
00050
00051 rgrl_feature_set_bins( feature_vector const& features,
00052 double bin_size = 10,
00053 rgrl_feature_set_label const& label = rgrl_feature_set_label() );
00054
00055 ~rgrl_feature_set_bins();
00056
00057 void
00058 features_in_region( feature_vector& results, rgrl_mask_box const& roi ) const;
00059
00060
00061
00062 void
00063 features_within_radius( feature_vector& results, vnl_vector<double> const& center, double radius ) const;
00064
00065
00066 rgrl_feature_sptr
00067 nearest_feature( const vnl_vector<double>& loc ) const;
00068
00069
00070 rgrl_feature_sptr
00071 nearest_feature( rgrl_feature_sptr const& feature ) const;
00072
00073
00074 void
00075 features_within_radius( feature_vector& results, rgrl_feature_sptr const& feature, double distance ) const;
00076
00077
00078 void
00079 k_nearest_features( feature_vector& results, const vnl_vector<double>& feature_loc, unsigned int k ) const;
00080
00081
00082 void
00083 k_nearest_features( feature_vector& results, rgrl_feature_sptr const& feature, unsigned int k ) const;
00084
00085
00086 rgrl_mask_box
00087 bounding_box() const;
00088
00089
00090 const vcl_type_info&
00091 type() const;
00092
00093
00094 rgrl_type_macro( rgrl_feature_set_bins, rgrl_feature_set );
00095
00096 private:
00097 typedef rsdl_bins<N,double,rgrl_feature_sptr> bin_type;
00098
00099 const vcl_type_info* feature_type_;
00100
00101 rgrl_mask_box bounding_box_;
00102
00103
00104 vcl_auto_ptr< bin_type > bins_;
00105
00106
00107
00108
00109 };
00110
00111
00112 #endif // rgrl_feature_set_bins_h_