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>
52 template <
typename T>
class Index;
58 template <
typename T>
class PointRepresentation;
66 template <
typename Po
intT,
typename Dist = ::flann::L2_Simple<
float> >
87 typedef boost::shared_ptr<KdTreeFLANN<PointT> >
Ptr;
88 typedef boost::shared_ptr<const KdTreeFLANN<PointT> >
ConstPtr;
109 flann_index_ = k.flann_index_;
111 index_mapping_ = k.index_mapping_;
112 identity_mapping_ = k.identity_mapping_;
114 total_nr_points_ = k.total_nr_points_;
115 param_k_ = k.param_k_;
116 param_radius_ = k.param_radius_;
144 setInputCloud (
const PointCloudConstPtr &cloud,
const IndicesConstPtr &indices = IndicesConstPtr ());
162 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const;
182 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const;
194 convertCloudToArray (
const PointCloud &cloud);
202 convertCloudToArray (
const PointCloud &cloud,
const std::vector<int> &indices);
207 getName ()
const {
return (
"KdTreeFLANN"); }
210 boost::shared_ptr<FLANNIndex> flann_index_;
216 std::vector<int> index_mapping_;
219 bool identity_mapping_;
225 int total_nr_points_;
228 ::flann::SearchParams param_k_;
231 ::flann::SearchParams param_radius_;
235 #ifdef PCL_NO_PRECOMPILE
236 #include <pcl/kdtree/impl/kdtree_flann.hpp>
KdTreeFLANN< PointT > & operator=(const KdTreeFLANN< PointT > &k)
Copy operator.
void setSortedResults(bool sorted)
::flann::Index< Dist > FLANNIndex
KdTreeFLANN(bool sorted=true)
Default Constructor for KdTreeFLANN.
void setEpsilon(float eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
KdTree< PointT >::PointCloud PointCloud
boost::shared_ptr< KdTreeFLANN< PointT > > Ptr
boost::shared_ptr< const KdTreeFLANN< PointT > > ConstPtr
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
boost::shared_ptr< std::vector< int > > IndicesPtr
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.
KdTree represents the base spatial locator class for kd-tree implementations.
A point structure representing Euclidean xyz coordinates, and the RGB color.
KdTree< PointT >::PointCloudConstPtr PointCloudConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
boost::shared_ptr< const PointCloud > PointCloudConstPtr
virtual ~KdTreeFLANN()
Destructor for KdTreeFLANN.
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.