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

search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search functions using KdTree structure. More...

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

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

List of all members.

Public Types

typedef boost::shared_ptr
< KdTree< PointT > > 
Ptr
typedef boost::shared_ptr
< const KdTree< PointT > > 
ConstPtr
typedef boost::shared_ptr
< pcl::KdTreeFLANN< PointT > > 
KdTreeFLANNPtr
typedef boost::shared_ptr
< const pcl::KdTreeFLANN
< PointT > > 
KdTreeFLANNConstPtr
typedef PointCloud::Ptr PointCloudPtr

Public Member Functions

 KdTree (bool sorted=true)
 Constructor for KdTree.
virtual ~KdTree ()
 Destructor for KdTree.
void setEpsilon (double eps)
 Set the search epsilon precision (error bound) for nearest neighbors searches.
double getEpsilon ()
 Get the search epsilon precision (error bound) for nearest neighbors searches.
void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices)
 Provide a pointer to the input dataset.
void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset.
PointCloudConstPtr getInputCloud ()
 Get a pointer to the input dataset as passed by the user.
virtual IndicesConstPtr const getIndices ()
 Get a pointer to the set of input indices used as passed by the user.
int nearestKSearch (const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_distances)
 Search for the k-nearest neighbors for the given query point.
int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_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_distances)
 Search for the k-nearest neighbors for the given query point (zero-copy).
int radiusSearch (const PointT &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, int max_nn=-1) const
 Search for all the nearest neighbors of the query point in a given radius.
int radiusSearch (const PointCloud &cloud, int index, 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.
int radiusSearch (int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=-1) const
 Search for all the nearest neighbors of the query point in a given radius (zero-copy).
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.
virtual int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)=0
 Search for the k-nearest neighbors for the given query point.
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.
virtual int radiusSearch (const PointCloud &cloud, int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_distances, int max_nn=-1)=0
 Search for all the nearest neighbors of the query point in a given radius.
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.

Detailed Description

search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search functions using KdTree structure.

KdTree is a generic type of 3D spatial locator using kD-tree structures. The class is making use of the FLANN (Fast Library for Approximate Nearest Neighbor) project by Marius Muja and David Lowe.

Author:
Radu B. Rusu

Member Typedef Documentation

typedef boost::shared_ptr<const KdTree<PointT> > pcl::search::KdTree::ConstPtr

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

Definition at line 69 of file kdtree.h.

typedef boost::shared_ptr<const pcl::KdTreeFLANN<PointT> > pcl::search::KdTree::KdTreeFLANNConstPtr

Definition at line 72 of file kdtree.h.

typedef boost::shared_ptr<pcl::KdTreeFLANN<PointT> > pcl::search::KdTree::KdTreeFLANNPtr

Definition at line 71 of file kdtree.h.

Reimplemented in pcl::search::Octree, and pcl::search::AutotunedSearch.

Definition at line 56 of file search.h.

typedef boost::shared_ptr<KdTree<PointT> > pcl::search::KdTree::Ptr

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

Definition at line 68 of file kdtree.h.


Constructor & Destructor Documentation

pcl::search::KdTree::KdTree ( bool  sorted = true) [inline]

Constructor for KdTree.

Parameters:
sortedset to true if the nearest neighbor search results need to be sorted in ascending order based on their distance to the query point

Definition at line 81 of file kdtree.h.

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

Destructor for KdTree.

Definition at line 88 of file kdtree.h.


Member Function Documentation

double pcl::search::KdTree::getEpsilon ( ) [inline]

Get the search epsilon precision (error bound) for nearest neighbors searches.

Definition at line 103 of file kdtree.h.

virtual IndicesConstPtr const pcl::search::KdTree::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 137 of file kdtree.h.

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

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

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

Definition at line 130 of file kdtree.h.

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

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_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Implemented in pcl::search::OrganizedNeighbor, pcl::search::AutotunedSearch, and pcl::search::Octree.

int pcl::search::KdTree::nearestKSearch ( const PointT &  point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_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 151 of file kdtree.h.

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

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

Definition at line 166 of file kdtree.h.

int pcl::search::KdTree::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_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 184 of file kdtree.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.

virtual int pcl::search::Search::radiusSearch ( const PointCloud cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) [pure virtual, inherited]

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

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the 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

Implemented in pcl::search::AutotunedSearch, pcl::search::OrganizedNeighbor, and pcl::search::Octree.

int pcl::search::KdTree::radiusSearch ( const PointT &  point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
int  max_nn = -1 
) const [inline, virtual]

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

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

Definition at line 198 of file kdtree.h.

int pcl::search::KdTree::radiusSearch ( const PointCloud &  cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) [inline]

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

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the 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 215 of file kdtree.h.

int pcl::search::KdTree::radiusSearch ( int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances,
int  max_nn = -1 
) const [inline, virtual]

Search for all the nearest neighbors of the query point in a given radius (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]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

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

Definition at line 231 of file kdtree.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.

void pcl::search::KdTree::setEpsilon ( double  eps) [inline]

Set the search epsilon precision (error bound) for nearest neighbors searches.

Parameters:
epsprecision (error bound) for nearest neighbors searches

Definition at line 96 of file kdtree.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::KdTree::setInputCloud ( const PointCloudConstPtr &  cloud,
const IndicesConstPtr &  indices 
) [inline]

Provide a pointer to the input dataset.

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

Definition at line 113 of file kdtree.h.

void pcl::search::KdTree::setInputCloud ( const PointCloudConstPtr &  cloud) [inline]

Provide a pointer to the input dataset.

Parameters:
cloudthe const boost shared pointer to a PointCloud message

Definition at line 122 of file kdtree.h.


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