41 #ifndef PCL_KDTREE_KDTREE_FLANN_H_ 42 #define PCL_KDTREE_KDTREE_FLANN_H_ 44 #include <pcl/kdtree/kdtree.h> 45 #include <pcl/kdtree/flann.h> 47 #include <boost/shared_array.hpp> 54 template <
typename T>
class Index;
60 template <
typename T>
class PointRepresentation;
68 template <
typename Po
intT,
typename Dist = ::flann::L2_Simple<
float> >
89 typedef boost::shared_ptr<KdTreeFLANN<PointT> >
Ptr;
90 typedef boost::shared_ptr<const KdTreeFLANN<PointT> >
ConstPtr;
111 flann_index_ = k.flann_index_;
113 index_mapping_ = k.index_mapping_;
114 identity_mapping_ = k.identity_mapping_;
116 total_nr_points_ = k.total_nr_points_;
117 param_k_ = k.param_k_;
118 param_radius_ = k.param_radius_;
164 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const;
184 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const;
196 convertCloudToArray (
const PointCloud &cloud);
204 convertCloudToArray (
const PointCloud &cloud,
const std::vector<int> &indices);
209 getName ()
const {
return (
"KdTreeFLANN"); }
212 boost::shared_ptr<FLANNIndex> flann_index_;
215 boost::shared_array<float> cloud_;
218 std::vector<int> index_mapping_;
221 bool identity_mapping_;
227 int total_nr_points_;
230 ::flann::SearchParams param_k_;
233 ::flann::SearchParams param_radius_;
237 #ifdef PCL_NO_PRECOMPILE 238 #include <pcl/kdtree/impl/kdtree_flann.hpp> KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
boost::shared_ptr< KdTree< FeatureT > > Ptr
void setSortedResults(bool sorted)
KdTreeFLANN(bool sorted=true)
Default Constructor for KdTreeFLANN.
int radiusSearch(const PointT &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
Search for all the nearest neighbors of the query point in a given radius.
virtual ~KdTreeFLANN()
Destructor for KdTreeFLANN.
boost::shared_ptr< std::vector< int > > IndicesPtr
KdTree< PointT >::PointCloud PointCloud
::flann::Index< Dist > FLANNIndex
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
Search for k-nearest neighbors for the given query point.
KdTree< PointT >::PointCloudConstPtr PointCloudConstPtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
KdTree represents the base spatial locator class for kd-tree implementations.
KdTreeFLANN< PointT > & operator=(const KdTreeFLANN< PointT > &k)
Copy operator.
boost::shared_ptr< KdTreeFLANN< PointT > > Ptr
boost::shared_ptr< const KdTreeFLANN< PointT > > ConstPtr