Point Cloud Library (PCL)
1.13.0dev

search::Octree is a wrapper class which implements nearest neighbor search operations based on the pcl::octree::Octree structure. More...
#include <pcl/search/octree.h>
Public Member Functions  
Octree (const double resolution)  
Octree constructor. More...  
~Octree () override=default  
Empty Destructor. More...  
void  setInputCloud (const PointCloudConstPtr &cloud) 
Provide a pointer to the input dataset. More...  
void  setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices) override 
Provide a pointer to the input dataset. More...  
int  nearestKSearch (const PointCloud &cloud, index_t index, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override 
Search for the knearest neighbors for the given query point. More...  
int  nearestKSearch (const PointT &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override 
Search for the knearest neighbors for the given query point. More...  
int  nearestKSearch (index_t index, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override 
Search for the knearest neighbors for the given query point (zerocopy). More...  
int  radiusSearch (const PointCloud &cloud, index_t index, double radius, Indices &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. More...  
int  radiusSearch (const PointT &p_q, double radius, Indices &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. More...  
int  radiusSearch (index_t index, double radius, Indices &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. More...  
void  approxNearestSearch (const PointCloudConstPtr &cloud, index_t query_index, index_t &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
void  approxNearestSearch (const PointT &p_q, index_t &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
void  approxNearestSearch (index_t query_index, index_t &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
uindex_t  boxSearch (const Eigen::Vector3f &min_pt, const Eigen::Vector3f &max_pt, Indices &k_indices) const 
Search for points within rectangular search area. More...  
Public Member Functions inherited from pcl::search::Search< PointT >  
Search (const std::string &name="", bool sorted=false)  
Constructor. More...  
virtual  ~Search ()=default 
Destructor. More...  
virtual const std::string &  getName () const 
Returns the search method name. More...  
virtual void  setSortedResults (bool sorted) 
sets whether the results should be sorted (ascending in the distance) or not More...  
virtual bool  getSortedResults () 
Gets whether the results should be sorted (ascending in the distance) or not Otherwise the results may be returned in any order. More...  
virtual PointCloudConstPtr  getInputCloud () const 
Get a pointer to the input point cloud dataset. More...  
virtual IndicesConstPtr  getIndices () const 
Get a pointer to the vector of indices used. More...  
template<typename PointTDiff >  
int  nearestKSearchT (const PointTDiff &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const 
Search for knearest neighbors for the given query point. More...  
virtual void  nearestKSearch (const PointCloud &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const 
Search for the knearest neighbors for the given query point. More...  
template<typename PointTDiff >  
void  nearestKSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const 
Search for the knearest neighbors for the given query point. More...  
template<typename PointTDiff >  
int  radiusSearchT (const PointTDiff &point, double radius, Indices &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. More...  
virtual void  radiusSearch (const PointCloud &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< 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. More...  
template<typename PointTDiff >  
void  radiusSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances, unsigned int max_nn=0) const 
Search for all the nearest neighbors of the query points in a given radius. More...  
Public Attributes  
OctreePointCloudSearchPtr  tree_ 
Additional Inherited Members  
Protected Member Functions inherited from pcl::search::Search< PointT >  
void  sortResults (Indices &indices, std::vector< float > &distances) const 
Protected Attributes inherited from pcl::search::Search< PointT >  
PointCloudConstPtr  input_ 
IndicesConstPtr  indices_ 
bool  sorted_results_ 
std::string  name_ 
search::Octree is a wrapper class which implements nearest neighbor search operations based on the pcl::octree::Octree structure.
The octree pointcloud class needs to be initialized with its voxel resolution. Its bounding box is automatically adjusted according to the pointcloud dimension or it can be predefined. Note: The tree depth equates to the resolution and the bounding box dimensions of the octree.
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::ConstPtr = shared_ptr<const pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchConstPtr = typename pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap>::ConstPtr 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchPtr = typename pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap>::Ptr 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloud = pcl::PointCloud<PointT> 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudConstPtr = typename PointCloud::ConstPtr 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudPtr = typename PointCloud::Ptr 
using pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Ptr = shared_ptr<pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > 

inline 

overridedefault 
Empty Destructor.

inline 
Search for approximate nearest neighbor at the query point.
[in]  cloud  the point cloud data 
[in]  query_index  the index in cloud representing the query point 
[out]  result_index  the resultant index of the neighbor point 
[out]  sqr_distance  the resultant squared distance to the neighboring point 
Definition at line 247 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inline 
Search for approximate nearest neighbor at the query point.
[in]  p_q  the given query point 
[out]  result_index  the resultant index of the neighbor point 
[out]  sqr_distance  the resultant squared distance to the neighboring point 
Definition at line 259 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inline 
Search for approximate nearest neighbor at the query point.
query_index  index representing the query point in the dataset given by setInputCloud. If indices were given in setInputCloud, index will be the position in the indices vector. 
result_index  the resultant index of the neighbor point 
sqr_distance  the resultant squared distance to the neighboring point 
Definition at line 272 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inline 
Search for points within rectangular search area.
[in]  min_pt  lower corner of search area 
[in]  max_pt  upper corner of search area 
[out]  k_indices  the resultant point indices 
Definition at line 283 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
Search for the knearest neighbors for the given query point.
[in]  cloud  the point cloud data 
[in]  index  the index in cloud representing the query point 
[in]  k  the number of neighbors to search for 
[out]  k_indices  the resultant indices of the neighboring points (must be resized to k a priori!) 
[out]  k_sqr_distances  the resultant squared distances to the neighboring points (must be resized to k a priori!) 
Reimplemented from pcl::search::Search< PointT >.
Definition at line 137 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
Search for the knearest neighbors for the given query point.
[in]  point  the given query point 
[in]  k  the number of neighbors to search for 
[out]  k_indices  the resultant indices of the neighboring points (must be resized to k a priori!) 
[out]  k_sqr_distances  the resultant squared distances to the neighboring points (must be resized to k a priori!) 
Implements pcl::search::Search< PointT >.
Definition at line 152 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
Search for the knearest neighbors for the given query point (zerocopy).
[in]  index  the index representing the query point in the dataset given by setInputCloud if indices were given in setInputCloud, index will be the position in the indices vector 
[in]  k  the number of neighbors to search for 
[out]  k_indices  the resultant indices of the neighboring points (must be resized to k a priori!) 
[out]  k_sqr_distances  the resultant squared distances to the neighboring points (must be resized to k a priori!) 
Reimplemented from pcl::search::Search< PointT >.
Definition at line 170 of file octree.h.
References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
search for all neighbors of query point that are within a given radius.
cloud  the point cloud data 
index  the index in cloud representing the query point 
radius  the radius of the sphere bounding all of p_q's neighbors 
k_indices  the resultant indices of the neighboring points 
k_sqr_distances  the resultant squared distances to the neighboring points 
max_nn  if given, bounds the maximum returned neighbors to this value 
Reimplemented from pcl::search::Search< PointT >.
Definition at line 185 of file octree.h.
References pcl::search::Search< PointT >::sorted_results_, pcl::search::Search< PointT >::sortResults(), and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
search for all neighbors of query point that are within a given radius.
p_q  the given query point 
radius  the radius of the sphere bounding all of p_q's neighbors 
k_indices  the resultant indices of the neighboring points 
k_sqr_distances  the resultant squared distances to the neighboring points 
max_nn  if given, bounds the maximum returned neighbors to this value 
Implements pcl::search::Search< PointT >.
Definition at line 207 of file octree.h.
References pcl::search::Search< PointT >::sorted_results_, pcl::search::Search< PointT >::sortResults(), and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
search for all neighbors of query point that are within a given radius.
index  index representing the query point in the dataset given by setInputCloud. If indices were given in setInputCloud, index will be the position in the indices vector 
radius  radius of the sphere bounding all of p_q's neighbors 
k_indices  the resultant indices of the neighboring points 
k_sqr_distances  the resultant squared distances to the neighboring points 
max_nn  if given, bounds the maximum returned neighbors to this value 
Reimplemented from pcl::search::Search< PointT >.
Definition at line 229 of file octree.h.
References pcl::search::Search< PointT >::sorted_results_, pcl::search::Search< PointT >::sortResults(), and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inline 
Provide a pointer to the input dataset.
[in]  cloud  the const boost shared pointer to a PointCloud message 
Definition at line 105 of file octree.h.
References pcl::search::Search< PointT >::input_, and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

inlineoverridevirtual 
Provide a pointer to the input dataset.
[in]  cloud  the const boost shared pointer to a PointCloud message 
[in]  indices  the point indices subset that is to be used from cloud 
Reimplemented from pcl::search::Search< PointT >.
Definition at line 118 of file octree.h.
References pcl::search::Search< PointT >::indices_, pcl::search::Search< PointT >::input_, and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.
OctreePointCloudSearchPtr pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_ 
Definition at line 82 of file octree.h.
Referenced by pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch(), pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::boxSearch(), pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch(), pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::radiusSearch(), and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::setInputCloud().