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 #ifndef PCL_SMOOTHEDSURFACESKEYPOINT_H_
00039 #define PCL_SMOOTHEDSURFACESKEYPOINT_H_
00040
00041 #include <pcl/keypoints/keypoint.h>
00042
00043 namespace pcl
00044 {
00054 template <typename PointT, typename PointNT>
00055 class SmoothedSurfacesKeypoint : public Keypoint <PointT, PointT>
00056 {
00057 public:
00058 using PCLBase<PointT>::input_;
00059 using Keypoint<PointT, PointT>::name_;
00060 using Keypoint<PointT, PointT>::tree_;
00061 using Keypoint<PointT, PointT>::initCompute;
00062
00063 typedef pcl::PointCloud<PointT> PointCloudT;
00064 typedef typename PointCloudT::ConstPtr PointCloudTConstPtr;
00065 typedef pcl::PointCloud<PointNT> PointCloudNT;
00066 typedef typename PointCloudNT::ConstPtr PointCloudNTConstPtr;
00067 typedef typename PointCloudT::Ptr PointCloudTPtr;
00068 typedef typename Keypoint<PointT, PointT>::KdTreePtr KdTreePtr;
00069
00070 SmoothedSurfacesKeypoint ()
00071 : Keypoint<PointT, PointT> (),
00072 neighborhood_constant_ (0.5f),
00073 clouds_ (),
00074 cloud_normals_ (),
00075 cloud_trees_ (),
00076 normals_ (),
00077 scales_ (),
00078 input_scale_ (0.0f),
00079 input_index_ ()
00080 {
00081 name_ = "SmoothedSurfacesKeypoint";
00082
00083
00084 Keypoint<PointT, PointT>::search_radius_ = 0.1;
00085 }
00086
00087 void
00088 addSmoothedPointCloud (const PointCloudTConstPtr &cloud,
00089 const PointCloudNTConstPtr &normals,
00090 KdTreePtr &kdtree,
00091 float &scale);
00092
00093
00094 void
00095 resetClouds ();
00096
00097 inline void
00098 setNeighborhoodConstant (float neighborhood_constant) { neighborhood_constant_ = neighborhood_constant; }
00099
00100 inline float
00101 getNeighborhoodConstant () { return neighborhood_constant_; }
00102
00103 inline void
00104 setInputNormals (const PointCloudNTConstPtr &normals) { normals_ = normals; }
00105
00106 inline void
00107 setInputScale (float input_scale) { input_scale_ = input_scale; }
00108
00109 void
00110 detectKeypoints (PointCloudT &output);
00111
00112 protected:
00113 bool
00114 initCompute ();
00115
00116 private:
00117 float neighborhood_constant_;
00118 std::vector<PointCloudTConstPtr> clouds_;
00119 std::vector<PointCloudNTConstPtr> cloud_normals_;
00120 std::vector<KdTreePtr> cloud_trees_;
00121 PointCloudNTConstPtr normals_;
00122 std::vector<std::pair<float, size_t> > scales_;
00123 float input_scale_;
00124 size_t input_index_;
00125
00126 static bool
00127 compareScalesFunction (const std::pair<float, size_t> &a,
00128 const std::pair<float, size_t> &b) { return a.first < b.first; }
00129 };
00130 }
00131
00132 #endif