Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef PCL_PYRAMID_FEATURE_MATCHING_H_
00042 #define PCL_PYRAMID_FEATURE_MATCHING_H_
00043
00044 #include <pcl/pcl_base.h>
00045 #include <pcl/point_representation.h>
00046
00047 namespace pcl
00048 {
00067 template <typename PointFeature>
00068 class PyramidFeatureHistogram : public PCLBase<PointFeature>
00069 {
00070 public:
00071 using PCLBase<PointFeature>::input_;
00072
00073 typedef boost::shared_ptr<PyramidFeatureHistogram<PointFeature> > Ptr;
00074 typedef Ptr PyramidFeatureHistogramPtr;
00075 typedef boost::shared_ptr<const pcl::PointRepresentation<PointFeature> > FeatureRepresentationConstPtr;
00076
00077
00079 PyramidFeatureHistogram ();
00080
00084 inline void
00085 setInputDimensionRange (std::vector<std::pair<float, float> > &dimension_range_input)
00086 { dimension_range_input_ = dimension_range_input; }
00087
00089 inline std::vector<std::pair<float, float> >
00090 getInputDimensionRange () { return dimension_range_input_; }
00091
00095 inline void
00096 setTargetDimensionRange (std::vector<std::pair<float, float> > &dimension_range_target)
00097 { dimension_range_target_ = dimension_range_target; }
00098
00100 inline std::vector<std::pair<float, float> >
00101 getTargetDimensionRange () { return dimension_range_target_; }
00102
00106 inline void
00107 setPointRepresentation (const FeatureRepresentationConstPtr& feature_representation) { feature_representation_ = feature_representation; }
00108
00110 inline FeatureRepresentationConstPtr const
00111 getPointRepresentation () { return feature_representation_; }
00112
00114 void
00115 compute ();
00116
00118 inline bool
00119 isComputed () { return is_computed_; }
00120
00126 static float
00127 comparePyramidFeatureHistograms (const PyramidFeatureHistogramPtr &pyramid_a,
00128 const PyramidFeatureHistogramPtr &pyramid_b);
00129
00130
00131 private:
00132 size_t nr_dimensions, nr_levels, nr_features;
00133 std::vector<std::pair<float, float> > dimension_range_input_, dimension_range_target_;
00134 FeatureRepresentationConstPtr feature_representation_;
00135 bool is_computed_;
00136
00138 bool
00139 initializeHistogram ();
00140
00144 void
00145 convertFeatureToVector (const PointFeature &feature,
00146 std::vector<float> &feature_vector);
00147
00149 void
00150 addFeature (std::vector<float> &feature);
00151
00157 inline unsigned int&
00158 at (std::vector<size_t> &access,
00159 size_t &level);
00160
00165 inline unsigned int&
00166 at (std::vector<float> &feature,
00167 size_t &level);
00168
00170 struct PyramidFeatureHistogramLevel
00171 {
00172 PyramidFeatureHistogramLevel () :
00173 hist (),
00174 bins_per_dimension (),
00175 bin_step ()
00176 {
00177 }
00178
00179 PyramidFeatureHistogramLevel (std::vector<size_t> &a_bins_per_dimension, std::vector<float> &a_bin_step) :
00180 hist (),
00181 bins_per_dimension (a_bins_per_dimension),
00182 bin_step (a_bin_step)
00183 {
00184 initializeHistogramLevel ();
00185 }
00186
00187 void
00188 initializeHistogramLevel ();
00189
00190 std::vector<unsigned int> hist;
00191 std::vector<size_t> bins_per_dimension;
00192 std::vector<float> bin_step;
00193 };
00194 std::vector<PyramidFeatureHistogramLevel> hist_levels;
00195 };
00196 }
00197
00198 #ifdef PCL_NO_PRECOMPILE
00199 #include <pcl/registration/impl/pyramid_feature_matching.hpp>
00200 #endif
00201
00202 #endif // PCL_PYRAMID_FEATURE_MATCHING_H_