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