40 #ifndef PCL_KDTREE_IO_IMPL_HPP_
41 #define PCL_KDTREE_IO_IMPL_HPP_
43 #include <pcl/kdtree/io.h>
46 template <
typename Po
int1T,
typename Po
int2T>
void
50 std::vector<int> &indices)
55 std::vector<int> nn_idx (1);
56 std::vector<float> nn_dists (1);
57 indices.resize (cloud_in->
points.size ());
58 for (std::size_t i = 0; i < cloud_in->
points.size (); ++i)
61 indices[i] = nn_idx[0];
66 template <
typename Po
intT>
void
70 std::vector<int> &indices)
75 std::vector<int> nn_idx (1);
76 std::vector<float> nn_dists (1);
77 indices.resize (cloud_in->
points.size ());
78 for (std::size_t i = 0; i < cloud_in->
points.size (); ++i)
81 indices[i] = nn_idx[0];
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override
Search for k-nearest neighbors for the given query point.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input dataset.
int nearestKSearchT(const PointTDiff &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.
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
shared_ptr< const PointCloud< PointT > > ConstPtr
void getApproximateIndices(const typename pcl::PointCloud< PointT >::ConstPtr &cloud_in, const typename pcl::PointCloud< PointT >::ConstPtr &cloud_ref, std::vector< int > &indices)
Get a set of approximate indices for a given point cloud into a reference point cloud.