Point Cloud Library (PCL)
1.9.1dev

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 Types  
typedef boost::shared_ptr< pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT > >  Ptr 
typedef boost::shared_ptr< const pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT > >  ConstPtr 
typedef boost::shared_ptr< std::vector< int > >  IndicesPtr 
typedef boost::shared_ptr< const std::vector< int > >  IndicesConstPtr 
typedef pcl::PointCloud< PointT >  PointCloud 
typedef boost::shared_ptr< PointCloud >  PointCloudPtr 
typedef boost::shared_ptr< const PointCloud >  PointCloudConstPtr 
typedef boost::shared_ptr< pcl::octree::OctreePointCloudSearch< PointT, LeafTWrap, BranchTWrap > >  OctreePointCloudSearchPtr 
typedef boost::shared_ptr< const pcl::octree::OctreePointCloudSearch< PointT, LeafTWrap, BranchTWrap > >  OctreePointCloudSearchConstPtr 
Public Types inherited from pcl::search::Search< PointT >  
typedef pcl::PointCloud< PointT >  PointCloud 
typedef PointCloud::Ptr  PointCloudPtr 
typedef PointCloud::ConstPtr  PointCloudConstPtr 
typedef boost::shared_ptr< pcl::search::Search< PointT > >  Ptr 
typedef boost::shared_ptr< const pcl::search::Search< PointT > >  ConstPtr 
typedef boost::shared_ptr< std::vector< int > >  IndicesPtr 
typedef boost::shared_ptr< const std::vector< int > >  IndicesConstPtr 
Public Member Functions  
Octree (const double resolution)  
Octree constructor. More...  
~Octree ()  
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, int index, int k, std::vector< int > &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, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const override 
Search for the knearest neighbors for the given query point. More...  
int  nearestKSearch (int index, int k, std::vector< int > &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, 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. More...  
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. More...  
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. More...  
void  approxNearestSearch (const PointCloudConstPtr &cloud, int query_index, int &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
void  approxNearestSearch (const PointT &p_q, int &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
void  approxNearestSearch (int query_index, int &result_index, float &sqr_distance) 
Search for approximate nearest neighbor at the query point. More...  
Public Member Functions inherited from pcl::search::Search< PointT >  
Search (const std::string &name="", bool sorted=false)  
Constructor. More...  
virtual  ~Search () 
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 void  setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) 
Pass the input dataset that the search will be performed on. 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, std::vector< int > &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 std::vector< int > &indices, int k, std::vector< std::vector< int > > &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 std::vector< int > &indices, int k, std::vector< std::vector< int > > &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, std::vector< int > &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 std::vector< int > &indices, double radius, std::vector< std::vector< int > > &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 std::vector< int > &indices, double radius, std::vector< std::vector< int > > &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 (std::vector< int > &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.
typedef boost::shared_ptr<const pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::ConstPtr 
typedef boost::shared_ptr<const std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesConstPtr 
typedef boost::shared_ptr<std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesPtr 
typedef boost::shared_ptr<const pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchConstPtr 
typedef boost::shared_ptr<pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchPtr 
typedef pcl::PointCloud<PointT> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloud 
typedef boost::shared_ptr<const PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudConstPtr 
typedef boost::shared_ptr<PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudPtr 
typedef boost::shared_ptr<pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Ptr 

inline 

inline 

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 

inline 

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 

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 >.

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 >.

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 >.

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 >.

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 >.

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 >.

inline 
Provide a pointer to the input dataset.
[in]  cloud  the const boost shared pointer to a PointCloud message 

inlineoverride 
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 
OctreePointCloudSearchPtr pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_ 