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_GFPFH_H_
00042 #define PCL_GFPFH_H_
00043
00044 #include <pcl/features/feature.h>
00045
00046 namespace pcl
00047 {
00064 template <typename PointInT, typename PointLT, typename PointOutT>
00065 class GFPFHEstimation : public FeatureFromLabels<PointInT, PointLT, PointOutT>
00066 {
00067 public:
00068 typedef boost::shared_ptr<GFPFHEstimation<PointInT, PointLT, PointOutT> > Ptr;
00069 typedef boost::shared_ptr<const GFPFHEstimation<PointInT, PointLT, PointOutT> > ConstPtr;
00070 using FeatureFromLabels<PointInT, PointLT, PointOutT>::feature_name_;
00071 using FeatureFromLabels<PointInT, PointLT, PointOutT>::getClassName;
00072 using FeatureFromLabels<PointInT, PointLT, PointOutT>::indices_;
00073 using FeatureFromLabels<PointInT, PointLT, PointOutT>::k_;
00074 using FeatureFromLabels<PointInT, PointLT, PointOutT>::search_parameter_;
00075 using FeatureFromLabels<PointInT, PointLT, PointOutT>::surface_;
00076
00077 using FeatureFromLabels<PointInT, PointLT, PointOutT>::input_;
00078 using FeatureFromLabels<PointInT, PointLT, PointOutT>::labels_;
00079
00080 typedef typename Feature<PointInT, PointOutT>::PointCloudOut PointCloudOut;
00081 typedef typename Feature<PointInT, PointOutT>::PointCloudIn PointCloudIn;
00082
00084 GFPFHEstimation () :
00085 octree_leaf_size_ (0.01),
00086 number_of_classes_ (16),
00087 descriptor_size_ (PointOutT::descriptorSize ())
00088 {
00089 feature_name_ = "GFPFHEstimation";
00090 }
00091
00094 inline void
00095 setOctreeLeafSize (double size) { octree_leaf_size_ = size; }
00096
00098 inline double
00099 getOctreeLeafSize () { return (octree_leaf_size_); }
00100
00102 inline uint32_t
00103 emptyLabel () const { return 0; }
00104
00106 inline uint32_t
00107 getNumberOfClasses () const { return number_of_classes_; }
00108
00112 inline void
00113 setNumberOfClasses (uint32_t n) { number_of_classes_ = n; }
00114
00116 inline int
00117 descriptorSize () const { return descriptor_size_; }
00118
00122 void
00123 compute (PointCloudOut &output);
00124
00125 protected:
00126
00132 void
00133 computeFeature (PointCloudOut &output);
00134
00136 uint32_t
00137 getDominantLabel (const std::vector<int>& indices);
00138
00140 void computeTransitionHistograms (const std::vector< std::vector<int> >& label_histograms,
00141 std::vector< std::vector<int> >& transition_histograms);
00142
00144 void
00145 computeDistancesToMean (const std::vector< std::vector<int> >& transition_histograms,
00146 std::vector<float>& distances);
00147
00149 float
00150 computeHIKDistance (const std::vector<int>& histogram,
00151 const std::vector<float>& mean_histogram);
00152
00154 void
00155 computeDistanceHistogram (const std::vector<float>& distances,
00156 std::vector<float>& histogram);
00157
00159 void
00160 computeMeanHistogram (const std::vector< std::vector<int> >& histograms,
00161 std::vector<float>& mean_histogram);
00162
00163 private:
00165 double octree_leaf_size_;
00166
00168 uint32_t number_of_classes_;
00169
00171 int descriptor_size_;
00172 };
00173 }
00174
00175 #ifdef PCL_NO_PRECOMPILE
00176 #include <pcl/features/impl/gfpfh.hpp>
00177 #endif
00178
00179 #endif //#ifndef PCL_GFPFH_H_