pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT > Class Template Reference
[Module search]

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>

Inheritance diagram for pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >:
Collaboration graph
[legend]

List of all members.

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< PointTPointCloud
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 Member Functions

 Octree (const double resolution)
 Octree constructor.
virtual ~Octree ()
 Empty Destructor.
void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices)
 Provide a pointer to the input dataset.
int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point.
int nearestKSearch (const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point.
int nearestKSearch (int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point (zero-copy).
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
 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
 search for all neighbors of query point that are within a given radius.
int radiusSearch (int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
 search for all neighbors of query point that are within a given radius.
void approxNearestSearch (const PointCloudConstPtr &cloud, int query_index, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point.
void approxNearestSearch (const PointT &p_q, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point.
void approxNearestSearch (int query_index, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point.

Public Attributes

OctreePointCloudSearchPtr tree_

Detailed Description

template<typename PointT, typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
class pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >

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.

Note:
typename: PointT: type of point used in pointcloud
typename: LeafT: leaf node class (usuallt templated with integer indices values)
typename: OctreeT: octree implementation ()
Author:
Julius Kammerl

Definition at line 69 of file octree.h.


Member Typedef Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::ConstPtr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 74 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesConstPtr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 77 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesPtr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 76 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchConstPtr

Definition at line 85 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::OctreePointCloudSearchPtr

Definition at line 84 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef pcl::PointCloud<PointT> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloud

Reimplemented from pcl::search::Search< PointT >.

Definition at line 79 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudConstPtr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 81 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudPtr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 80 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<pcl::search::Octree<PointT,LeafTWrap,BranchTWrap,OctreeT> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Ptr

Reimplemented from pcl::search::Search< PointT >.

Definition at line 73 of file octree.h.


Constructor & Destructor Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Octree ( const double  resolution  )  [inline]

Octree constructor.

Parameters:
[in] resolution octree resolution at lowest octree level

Definition at line 95 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
virtual pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::~Octree (  )  [inline, virtual]

Empty Destructor.

Definition at line 103 of file octree.h.


Member Function Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( int  query_index,
int &  result_index,
float &  sqr_distance 
) [inline]

Search for approximate nearest neighbor at the query point.

Parameters:
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
Returns:
number of neighbors found

Definition at line 278 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( const PointT p_q,
int &  result_index,
float &  sqr_distance 
) [inline]

Search for approximate nearest neighbor at the query point.

Parameters:
[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 265 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( const PointCloudConstPtr cloud,
int  query_index,
int &  result_index,
float &  sqr_distance 
) [inline]

Search for approximate nearest neighbor at the query point.

Parameters:
[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
Returns:
number of neighbors found

Definition at line 253 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline, virtual]

Search for the k-nearest neighbors for the given query point (zero-copy).

Parameters:
[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!)
Returns:
number of neighbors found

Reimplemented from pcl::search::Search< PointT >.

Definition at line 176 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( const PointT point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline, virtual]

Search for the k-nearest neighbors for the given query point.

Parameters:
[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!)
Returns:
number of neighbors found

Implements pcl::search::Search< PointT >.

Definition at line 158 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( const PointCloud cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline, virtual]

Search for the k-nearest neighbors for the given query point.

Parameters:
[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!)
Returns:
number of neighbors found

Reimplemented from pcl::search::Search< PointT >.

Definition at line 143 of file octree.h.

References pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::radiusSearch ( int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const [inline, virtual]

search for all neighbors of query point that are within a given radius.

Parameters:
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
Returns:
number of neighbors found in radius

Reimplemented from pcl::search::Search< PointT >.

Definition at line 235 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_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::radiusSearch ( const PointT p_q,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const [inline, virtual]

search for all neighbors of query point that are within a given radius.

Parameters:
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
Returns:
number of neighbors found in radius

Implements pcl::search::Search< PointT >.

Definition at line 213 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_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::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 [inline, virtual]

search for all neighbors of query point that are within a given radius.

Parameters:
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
Returns:
number of neighbors found in radius

Reimplemented from pcl::search::Search< PointT >.

Definition at line 191 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_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices 
) [inline]

Provide a pointer to the input dataset.

Parameters:
[in] cloud the const boost shared pointer to a PointCloud message
[in] indices the point indices subset that is to be used from cloud

Definition at line 124 of file octree.h.

References pcl::search::Search< PointT >::indices_, pcl::search::Search< PointT >::input_, and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::setInputCloud ( const PointCloudConstPtr cloud  )  [inline]

Provide a pointer to the input dataset.

Parameters:
[in] cloud the const boost shared pointer to a PointCloud message

Definition at line 111 of file octree.h.

References pcl::search::Search< PointT >::input_, and pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_.


Member Data Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerPointIndices, typename BranchTWrap = pcl::octree::OctreeContainerEmpty, typename OctreeT = pcl::octree::OctreeBase<LeafTWrap, BranchTWrap >>
OctreePointCloudSearchPtr pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends