43 #include <pcl/kdtree/kdtree.h>
44 #include <flann/util/params.h>
52 template <
typename T>
class Index;
60 template <
typename IndexT>
66 template <
typename IndexT>
68 template <
typename IndexT>
85 template <
class FlannIndex,
96 const SearchParams& params);
111 template <
class FlannIndex,
122 const SearchParams& params);
131 template <
typename Po
intT,
typename Dist = ::flann::L2_Simple<
float>>
151 using Ptr = shared_ptr<KdTreeFLANN<PointT, Dist>>;
152 using ConstPtr = shared_ptr<const KdTreeFLANN<PointT, Dist>>;
174 flann_index_ = k.flann_index_;
176 index_mapping_ = k.index_mapping_;
177 identity_mapping_ = k.identity_mapping_;
179 total_nr_points_ = k.total_nr_points_;
180 param_k_ = k.param_k_;
181 param_radius_ = k.param_radius_;
236 std::vector<float>& k_sqr_distances)
const override;
259 std::vector<float>& k_sqr_distances,
260 unsigned int max_nn = 0)
const override;
283 getName()
const override
285 return (
"KdTreeFLANN");
289 std::shared_ptr<FLANNIndex> flann_index_;
293 std::shared_ptr<float> cloud_;
296 std::vector<int> index_mapping_;
299 bool identity_mapping_{
false};
309 ::flann::SearchParams param_k_;
312 ::flann::SearchParams param_radius_;
316 #ifdef PCL_NO_PRECOMPILE
317 #include <pcl/kdtree/impl/kdtree_flann.hpp>
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
KdTreeFLANN< PointT, Dist > & operator=(const KdTreeFLANN< PointT, Dist > &k)
Copy operator.
void setEpsilon(float eps) override
Set the search epsilon precision (error bound) for nearest neighbors searches.
~KdTreeFLANN() override
Destructor for KdTreeFLANN.
shared_ptr< const Indices > IndicesConstPtr
shared_ptr< KdTreeFLANN< PointT, Dist > > Ptr
int nearestKSearch(const PointT &point, unsigned int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override
Search for k-nearest neighbors for the given query point.
int radiusSearch(const PointT &point, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
Search for all the nearest neighbors of the query point in a given radius.
void setSortedResults(bool sorted)
KdTreeFLANN(bool sorted=true)
Default Constructor for KdTreeFLANN.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset.
KdTree represents the base spatial locator class for kd-tree implementations.
shared_ptr< const Indices > IndicesConstPtr
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< Indices > IndicesPtr
shared_ptr< KdTree< PointT > > Ptr
shared_ptr< const KdTree< PointT > > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
std::enable_if_t< compat_with_flann< IndexT >::value, bool > CompatWithFlann
std::enable_if_t<!compat_with_flann< IndexT >::value, bool > NotCompatWithFlann
shared_ptr< const Indices > IndicesConstPtr
detail::int_type_t< detail::index_type_size, false > uindex_t
Type used for an unsigned index in PCL.
IndicesAllocator<> Indices
Type used for indices in PCL.
int radius_search(const FlannIndex &index, const Query &query, Indices &indices, Distances &dists, float radius, const SearchParams ¶ms)
Compatibility template function to allow use of various types of indices with FLANN.
int knn_search(const FlannIndex &index, const Query &query, Indices &indices, Distances &dists, unsigned int k, const SearchParams ¶ms)
Compatibility template function to allow use of various types of indices with FLANN.
A point structure representing Euclidean xyz coordinates, and the RGB color.