40 #ifndef PCL_KDTREE_IO_IMPL_HPP_
41 #define PCL_KDTREE_IO_IMPL_HPP_
43 #include <pcl/kdtree/io.h>
44 #include <pcl/kdtree/kdtree_flann.h>
47 template <
typename Po
int1T,
typename Po
int2T>
void
51 std::vector<int> &indices)
56 std::vector<int> nn_idx (1);
57 std::vector<float> nn_dists (1);
58 indices.resize (cloud_in->
points.size ());
59 for (
size_t i = 0; i < cloud_in->
points.size (); ++i)
62 indices[i] = nn_idx[0];
67 template <
typename Po
intT>
void
71 std::vector<int> &indices)
76 std::vector<int> nn_idx (1);
77 std::vector<float> nn_dists (1);
78 indices.resize (cloud_in->
points.size ());
79 for (
size_t i = 0; i < cloud_in->
points.size (); ++i)
82 indices[i] = nn_idx[0];
86 #endif // PCL_KDTREE_IO_IMPL_H_
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
boost::shared_ptr< PointCloud< PointT > > Ptr
void getApproximateIndices(const typename pcl::PointCloud< PointT >::Ptr &cloud_in, const typename pcl::PointCloud< PointT >::Ptr &cloud_ref, std::vector< int > &indices)
Get a set of approximate indices for a given point cloud into a reference point cloud.
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.