Point Cloud Library (PCL)
1.10.0
|
41 #include <pcl/search/search.h>
42 #include <pcl/octree/octree_search.h>
96 ,
tree_ (new
pcl::octree::OctreePointCloudSearch<
PointT, LeafTWrap, BranchTWrap> (resolution))
112 tree_->deleteTree ();
113 tree_->setInputCloud (cloud);
114 tree_->addPointsFromInputCloud ();
125 tree_->deleteTree ();
126 tree_->setInputCloud (cloud, indices);
127 tree_->addPointsFromInputCloud ();
143 std::vector<float> &k_sqr_distances)
const override
145 return (
tree_->nearestKSearch (cloud, index, k, k_indices, k_sqr_distances));
158 std::vector<float> &k_sqr_distances)
const override
160 return (
tree_->nearestKSearch (point, k, k_indices, k_sqr_distances));
175 nearestKSearch (
int index,
int k, std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const override
177 return (
tree_->nearestKSearch (index, k, k_indices, k_sqr_distances));
193 std::vector<int> &k_indices,
194 std::vector<float> &k_sqr_distances,
195 unsigned int max_nn = 0)
const override
197 tree_->radiusSearch (cloud, index, radius, k_indices, k_sqr_distances, max_nn);
200 return (
static_cast<int> (k_indices.size ()));
214 std::vector<int> &k_indices,
215 std::vector<float> &k_sqr_distances,
216 unsigned int max_nn = 0)
const override
218 tree_->radiusSearch (p_q, radius, k_indices, k_sqr_distances, max_nn);
221 return (
static_cast<int> (k_indices.size ()));
235 std::vector<float> &k_sqr_distances,
unsigned int max_nn = 0)
const override
237 tree_->radiusSearch (index, radius, k_indices, k_sqr_distances, max_nn);
240 return (
static_cast<int> (k_indices.size ()));
255 return (
tree_->approxNearestSearch (cloud->points[query_index], result_index, sqr_distance));
266 return (
tree_->approxNearestSearch (p_q, result_index, sqr_distance));
279 return (
tree_->approxNearestSearch (query_index, result_index, sqr_distance));
286 #ifdef PCL_NO_PRECOMPILE
287 #include <pcl/octree/impl/octree_search.hpp>
289 #define PCL_INSTANTIATE_Octree(T) template class PCL_EXPORTS pcl::search::Octree<T>;
This file defines compatibility wrappers for low level I/O functions.
int radiusSearch(int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
search for all neighbors of query point that are within a given radius.
int radiusSearch(const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
search for all neighbors of query point that are within a given radius.
shared_ptr< pcl::search::Octree< PointInT, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::OctreeBase< pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty > > > Ptr
int nearestKSearch(int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override
Search for the k-nearest neighbors for the given query point (zero-copy).
void approxNearestSearch(const PointT &p_q, int &result_index, float &sqr_distance)
Search for approximate nearest neighbor at the query point.
typename pcl::octree::OctreePointCloudSearch< PointInT, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty >::ConstPtr OctreePointCloudSearchConstPtr
typename PointCloud::Ptr PointCloudPtr
Octree(const double resolution)
Octree constructor.
int nearestKSearch(const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override
Search for the k-nearest neighbors for the given query point.
search::Octree is a wrapper class which implements nearest neighbor search operations based on the pc...
int nearestKSearch(const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override
Search for the k-nearest neighbors for the given query point.
Octree container class that does store a vector of point indices.
A point structure representing Euclidean xyz coordinates, and the RGB color.
int radiusSearch(const PointCloud &cloud, int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
search for all neighbors of query point that are within a given radius.
~Octree()
Empty Destructor.
shared_ptr< const pcl::search::Octree< PointInT, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty, pcl::octree::OctreeBase< pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty > > > ConstPtr
PointCloudConstPtr input_
shared_ptr< OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT > > Ptr
void approxNearestSearch(const PointCloudConstPtr &cloud, int query_index, int &result_index, float &sqr_distance)
Search for approximate nearest neighbor at the query point.
typename PointCloud::ConstPtr PointCloudConstPtr
shared_ptr< std::vector< int > > IndicesPtr
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const std::vector< int > > IndicesConstPtr
shared_ptr< const PointCloud< PointT > > ConstPtr
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices) override
Provide a pointer to the input dataset.
void sortResults(std::vector< int > &indices, std::vector< float > &distances) const
OctreePointCloudSearchPtr tree_
void approxNearestSearch(int query_index, int &result_index, float &sqr_distance)
Search for approximate nearest neighbor at the query point.
Octree container class that does not store any information.
shared_ptr< const OctreePointCloudSearch< PointT, LeafContainerT, BranchContainerT > > ConstPtr
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
typename pcl::octree::OctreePointCloudSearch< PointInT, pcl::octree::OctreeContainerPointIndices, pcl::octree::OctreeContainerEmpty >::Ptr OctreePointCloudSearchPtr
void setInputCloud(const PointCloudConstPtr &cloud)
Provide a pointer to the input dataset.