Point Cloud Library (PCL)  1.3.1
Public Types | Public Member Functions | Public Attributes
pcl::search::Octree Class Reference

search::Octree is a wrapper class which implements nearest neighbor search operations based on the pcl::octree::Octree structure. More...

#include </builddir/build/BUILD/PCL-1.3.1-Source/search/include/pcl/search/octree.h>

Inheritance diagram for pcl::search::Octree:
Inheritance graph
[legend]
Collaboration diagram for pcl::search::Octree:
Collaboration graph
[legend]

List of all members.

Public Types

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, OctreeT > > 
Ptr
typedef boost::shared_ptr
< const
pcl::octree::OctreePointCloudSearch
< PointT, LeafTWrap, OctreeT > > 
ConstPtr

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.
PointCloudConstPtr getInputCloud ()
 Get a pointer to the input dataset as passed by the user.
IndicesConstPtr const getIndices ()
 Get a pointer to the set of input indices used as passed by the user.
int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)
 Search for the k-nearest neighbors for the given query point.
int nearestKSearch (const PointT &p, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)
 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)
 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, int max_nn=INT_MAX)
 search for all neighbors of query point that are within a given radius.
int radiusSearch (const PointT &p_q, const double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, int max_nn=INT_MAX) const
 search for all neighbors of query point that are within a given radius.
int radiusSearch (int index, const double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, int max_nn=INT_MAX) 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.
virtual void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices)
 Pass the input dataset that the search will be performed on.
virtual void setInputCloud (const PointCloudConstPtr &cloud)=0
 Pass the input dataset that the search will be performed on.
int nearestKSearchT (const PointTDiff &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)
 Search for the k-nearest neighbors for the given query point.
int radiusSearchT (const PointTDiff &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=-1)
 Search for all the nearest neighbors of the query point in a given radius.

Public Attributes

Ptr tree_

Detailed Description

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

Member Typedef Documentation

typedef boost::shared_ptr<const pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, OctreeT> > pcl::search::Octree::ConstPtr

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

Definition at line 80 of file octree.h.

typedef boost::shared_ptr<const std::vector<int> > pcl::search::Octree::IndicesConstPtr

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

Definition at line 72 of file octree.h.

typedef boost::shared_ptr<std::vector<int> > pcl::search::Octree::IndicesPtr

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

Definition at line 71 of file octree.h.

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

Definition at line 74 of file octree.h.

typedef boost::shared_ptr<const PointCloud> pcl::search::Octree::PointCloudConstPtr

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

Definition at line 76 of file octree.h.

typedef boost::shared_ptr<PointCloud> pcl::search::Octree::PointCloudPtr

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

Definition at line 75 of file octree.h.

typedef boost::shared_ptr<pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, OctreeT> > pcl::search::Octree::Ptr

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

Definition at line 79 of file octree.h.


Constructor & Destructor Documentation

pcl::search::Octree::Octree ( const double  resolution) [inline]

Octree constructor.

Parameters:
[in]resolutionoctree resolution at lowest octree level

Definition at line 86 of file octree.h.

virtual pcl::search::Octree::~Octree ( ) [inline, virtual]

Empty Destructor.

Definition at line 93 of file octree.h.


Member Function Documentation

void pcl::search::Octree::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]cloudthe point cloud data
[in]query_indexthe index in cloud representing the query point
[out]result_indexthe resultant index of the neighbor point
[out]sqr_distancethe resultant squared distance to the neighboring point
Returns:
number of neighbors found

Definition at line 238 of file octree.h.

void pcl::search::Octree::approxNearestSearch ( const PointT &  p_q,
int &  result_index,
float &  sqr_distance 
) [inline]

Search for approximate nearest neighbor at the query point.

Parameters:
p_qthe given query point
result_indexthe resultant index of the neighbor point
sqr_distancethe resultant squared distance to the neighboring point

Definition at line 250 of file octree.h.

void pcl::search::Octree::approxNearestSearch ( int  query_index,
int &  result_index,
float &  sqr_distance 
) [inline]

Search for approximate nearest neighbor at the query point.

Parameters:
query_indexindex 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_indexthe resultant index of the neighbor point
sqr_distancethe resultant squared distance to the neighboring point
Returns:
number of neighbors found

Definition at line 263 of file octree.h.

IndicesConstPtr const pcl::search::Octree::getIndices ( ) [inline, virtual]

Get a pointer to the set of input indices used as passed by the user.

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

Definition at line 129 of file octree.h.

PointCloudConstPtr pcl::search::Octree::getInputCloud ( ) [inline, virtual]

Get a pointer to the input dataset as passed by the user.

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

Definition at line 122 of file octree.h.

int pcl::search::Octree::nearestKSearch ( const PointCloud cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, virtual]

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

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_distancesthe 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 144 of file octree.h.

int pcl::search::Octree::nearestKSearch ( const PointT &  p,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, virtual]

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

Parameters:
[in]pointthe given query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_distancesthe 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 159 of file octree.h.

int pcl::search::Octree::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, virtual]

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

Parameters:
[in]indexthe 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]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_distancesthe 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 177 of file octree.h.

int pcl::search::Search::nearestKSearchT ( const PointTDiff &  point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) [inline, inherited]

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

Parameters:
[in]pointthe given query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Definition at line 118 of file search.h.

int pcl::search::Octree::radiusSearch ( const PointCloud cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
int  max_nn = INT_MAX 
) [inline, virtual]

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

Parameters:
cloudthe point cloud data
indexthe index in cloud representing the query point
radiusthe radius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

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

Definition at line 192 of file octree.h.

int pcl::search::Octree::radiusSearch ( const PointT &  p_q,
const double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
int  max_nn = INT_MAX 
) const [inline, virtual]

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

Parameters:
p_qthe given query point
radiusthe radius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

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

Definition at line 207 of file octree.h.

int pcl::search::Octree::radiusSearch ( int  index,
const double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
int  max_nn = INT_MAX 
) const [inline, virtual]

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

Parameters:
indexindex 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
radiusradius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

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

Definition at line 223 of file octree.h.

int pcl::search::Search::radiusSearchT ( const PointTDiff &  point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) [inline, inherited]

Search for all the nearest neighbors of the query point in a given radius.

Parameters:
[in]pointthe given query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_distancesthe resultant squared distances to the neighboring points
[in]max_nnif given, bounds the maximum returned neighbors to this value
Returns:
number of neighbors found in radius

Definition at line 177 of file search.h.

virtual void pcl::search::Search::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices 
) [inline, virtual, inherited]

Pass the input dataset that the search will be performed on.

Parameters:
[in]clouda const pointer to the PointCloud data
[in]indicesthe point indices subset that is to be used from the cloud

Definition at line 81 of file search.h.

virtual void pcl::search::Search::setInputCloud ( const PointCloudConstPtr cloud) [pure virtual, inherited]

Pass the input dataset that the search will be performed on.

Parameters:
[in]clouda const pointer to the PointCloud data
void pcl::search::Octree::setInputCloud ( const PointCloudConstPtr cloud) [inline]

Provide a pointer to the input dataset.

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

Definition at line 101 of file octree.h.

void pcl::search::Octree::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices 
) [inline]

Provide a pointer to the input dataset.

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

Definition at line 113 of file octree.h.


Member Data Documentation

Definition at line 81 of file octree.h.


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