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 #ifndef PCL_FEATURES_USC_H_
00041 #define PCL_FEATURES_USC_H_
00042
00043 #include <pcl/point_types.h>
00044 #include <pcl/features/feature.h>
00045
00046 namespace pcl
00047 {
00065 template <typename PointInT, typename PointOutT, typename PointRFT = pcl::ReferenceFrame>
00066 class UniqueShapeContext : public Feature<PointInT, PointOutT>,
00067 public FeatureWithLocalReferenceFrames<PointInT, PointRFT>
00068 {
00069 public:
00070 using Feature<PointInT, PointOutT>::feature_name_;
00071 using Feature<PointInT, PointOutT>::getClassName;
00072 using Feature<PointInT, PointOutT>::indices_;
00073 using Feature<PointInT, PointOutT>::search_parameter_;
00074 using Feature<PointInT, PointOutT>::search_radius_;
00075 using Feature<PointInT, PointOutT>::surface_;
00076 using Feature<PointInT, PointOutT>::fake_surface_;
00077 using Feature<PointInT, PointOutT>::input_;
00078 using Feature<PointInT, PointOutT>::searchForNeighbors;
00079 using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
00080
00081 typedef typename Feature<PointInT, PointOutT>::PointCloudOut PointCloudOut;
00082 typedef typename Feature<PointInT, PointOutT>::PointCloudIn PointCloudIn;
00083 typedef typename boost::shared_ptr<UniqueShapeContext<PointInT, PointOutT, PointRFT> > Ptr;
00084 typedef typename boost::shared_ptr<const UniqueShapeContext<PointInT, PointOutT, PointRFT> > ConstPtr;
00085
00086
00088 UniqueShapeContext () :
00089 radii_interval_(0), theta_divisions_(0), phi_divisions_(0), volume_lut_(0),
00090 azimuth_bins_(12), elevation_bins_(11), radius_bins_(15),
00091 min_radius_(0.1), point_density_radius_(0.2), descriptor_length_ (), local_radius_ (2.5)
00092 {
00093 feature_name_ = "UniqueShapeContext";
00094 search_radius_ = 2.5;
00095 }
00096
00097 virtual ~UniqueShapeContext() { }
00098
00102 inline void
00103 setAzimuthBins (size_t bins) { azimuth_bins_ = bins; }
00104
00106 inline size_t
00107 getAzimuthBins () const { return (azimuth_bins_); }
00108
00112 inline void
00113 setElevationBins (size_t bins) { elevation_bins_ = bins; }
00114
00116 inline size_t
00117 getElevationBins () const { return (elevation_bins_); }
00118
00122 inline void
00123 setRadiusBins (size_t bins) { radius_bins_ = bins; }
00124
00126 inline size_t
00127 getRadiusBins () const { return (radius_bins_); }
00128
00132 inline void
00133 setMinimalRadius (double radius) { min_radius_ = radius; }
00134
00136 inline double
00137 getMinimalRadius () const { return (min_radius_); }
00138
00143 inline void
00144 setPointDensityRadius (double radius) { point_density_radius_ = radius; }
00145
00147 inline double
00148 getPointDensityRadius () const { return (point_density_radius_); }
00149
00153 inline void
00154 setLocalRadius (double radius) { local_radius_ = radius; }
00155
00157 inline double
00158 getLocalRadius () const { return (local_radius_); }
00159
00160 protected:
00165 void
00166 computePointDescriptor (size_t index, std::vector<float> &desc);
00167
00169 virtual bool
00170 initCompute ();
00171
00175 virtual void
00176 computeFeature (PointCloudOut &output);
00177
00179 std::vector<float> radii_interval_;
00180
00182 std::vector<float> theta_divisions_;
00183
00185 std::vector<float> phi_divisions_;
00186
00188 std::vector<float> volume_lut_;
00189
00191 size_t azimuth_bins_;
00192
00194 size_t elevation_bins_;
00195
00197 size_t radius_bins_;
00198
00200 double min_radius_;
00201
00203 double point_density_radius_;
00204
00206 size_t descriptor_length_;
00207
00209 double local_radius_;
00210 private:
00214 void
00215 computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &) {}
00216 };
00217
00235 template <typename PointInT, typename PointRFT>
00236 class UniqueShapeContext<PointInT, Eigen::MatrixXf, PointRFT> : public UniqueShapeContext<PointInT, pcl::SHOT, PointRFT>
00237 {
00238 public:
00239 using FeatureWithLocalReferenceFrames<PointInT, PointRFT>::frames_;
00240 using UniqueShapeContext<PointInT, pcl::SHOT, PointRFT>::indices_;
00241 using UniqueShapeContext<PointInT, pcl::SHOT, PointRFT>::descriptor_length_;
00242 using UniqueShapeContext<PointInT, pcl::SHOT, PointRFT>::compute;
00243 using UniqueShapeContext<PointInT, pcl::SHOT, PointRFT>::computePointDescriptor;
00244
00245 private:
00249 virtual void
00250 computeFeatureEigen (pcl::PointCloud<Eigen::MatrixXf> &output);
00251
00255 void
00256 compute (pcl::PointCloud<pcl::SHOT> &) {}
00257 };
00258 }
00259
00260 #endif //#ifndef PCL_USC_H_