Point Cloud Library (PCL)
1.7.0
|
search::KdTree is a wrapper class which inherits the pcl::KdTree class for performing search functions using KdTree structure. More...
#include <pcl/search/kdtree.h>
Public Types | |
typedef Search< PointT > ::PointCloud | PointCloud |
typedef Search< PointT > ::PointCloudConstPtr | PointCloudConstPtr |
typedef boost::shared_ptr < std::vector< int > > | IndicesPtr |
typedef boost::shared_ptr < const std::vector< int > > | IndicesConstPtr |
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 boost::shared_ptr < const PointRepresentation < PointT > > | PointRepresentationConstPtr |
Public Member Functions | |
KdTree (bool sorted=true) | |
Constructor for KdTree. | |
virtual | ~KdTree () |
Destructor for KdTree. | |
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation) |
Provide a pointer to the point representation to use to convert points into k-D vectors. | |
PointRepresentationConstPtr | getPointRepresentation () const |
Get a pointer to the point representation used when converting points into k-D vectors. | |
void | setSortedResults (bool sorted_results) |
Sets whether the results have to be sorted or not. | |
void | setEpsilon (float eps) |
Set the search epsilon precision (error bound) for nearest neighbors searches. | |
float | getEpsilon () const |
Get the search epsilon precision (error bound) for nearest neighbors searches. | |
void | setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) |
Provide a pointer to the input dataset. | |
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 | radiusSearch (const PointT &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. | |
Protected Attributes | |
KdTreeFLANNPtr | tree_ |
A pointer to the internal KdTreeFLANN object. |
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.
typedef boost::shared_ptr<const KdTree<PointT> > pcl::search::KdTree< PointT >::ConstPtr |
Reimplemented from pcl::search::Search< PointT >.
typedef boost::shared_ptr<const std::vector<int> > pcl::search::KdTree< PointT >::IndicesConstPtr |
Reimplemented from pcl::search::Search< PointT >.
typedef boost::shared_ptr<std::vector<int> > pcl::search::KdTree< PointT >::IndicesPtr |
Reimplemented from pcl::search::Search< PointT >.
typedef boost::shared_ptr<const pcl::KdTreeFLANN<PointT> > pcl::search::KdTree< PointT >::KdTreeFLANNConstPtr |
typedef boost::shared_ptr<pcl::KdTreeFLANN<PointT> > pcl::search::KdTree< PointT >::KdTreeFLANNPtr |
typedef Search<PointT>::PointCloud pcl::search::KdTree< PointT >::PointCloud |
Reimplemented from pcl::search::Search< PointT >.
typedef Search<PointT>::PointCloudConstPtr pcl::search::KdTree< PointT >::PointCloudConstPtr |
Reimplemented from pcl::search::Search< PointT >.
typedef boost::shared_ptr<const PointRepresentation<PointT> > pcl::search::KdTree< PointT >::PointRepresentationConstPtr |
typedef boost::shared_ptr<KdTree<PointT> > pcl::search::KdTree< PointT >::Ptr |
Reimplemented from pcl::search::Search< PointT >.
pcl::search::KdTree< PointT >::KdTree | ( | bool | sorted = true | ) |
Constructor for KdTree.
[in] | sorted | set 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 46 of file kdtree.hpp.
virtual pcl::search::KdTree< PointT >::~KdTree | ( | ) | [inline, virtual] |
float pcl::search::KdTree< PointT >::getEpsilon | ( | ) | const [inline] |
PointRepresentationConstPtr pcl::search::KdTree< PointT >::getPointRepresentation | ( | ) | const [inline] |
int pcl::search::KdTree< PointT >::nearestKSearch | ( | const PointT & | point, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances | ||
) | const [virtual] |
Search for the k-nearest 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 88 of file kdtree.hpp.
Referenced by pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget >::computeCovariances().
int pcl::search::KdTree< PointT >::radiusSearch | ( | const PointT & | point, |
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances, | ||
unsigned int | max_nn = 0 |
||
) | const [virtual] |
Search for all the nearest neighbors of the query point in a given radius.
[in] | point | the given query point |
[in] | radius | the radius of the sphere bounding all of p_q's neighbors |
[out] | k_indices | the resultant indices of the neighboring points |
[out] | k_sqr_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value. If max_nn is set to 0 or to a number higher than the number of points in the input cloud, all neighbors in radius will be returned. |
Implements pcl::search::Search< PointT >.
Definition at line 97 of file kdtree.hpp.
Referenced by pcl::HarrisKeypoint6D< PointInT, PointOutT, NormalT >::refineCorners().
void pcl::search::KdTree< PointT >::setEpsilon | ( | float | eps | ) |
Set the search epsilon precision (error bound) for nearest neighbors searches.
[in] | eps | precision (error bound) for nearest neighbors searches |
Definition at line 70 of file kdtree.hpp.
References pcl::search::KdTree< PointT >::setEpsilon().
Referenced by pcl::search::KdTree< PointT >::setEpsilon().
void pcl::search::KdTree< PointT >::setInputCloud | ( | const PointCloudConstPtr & | cloud, |
const IndicesConstPtr & | indices = IndicesConstPtr () |
||
) | [virtual] |
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 77 of file kdtree.hpp.
References pcl::search::KdTree< PointT >::setInputCloud().
Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute(), pcl::HarrisKeypoint6D< PointInT, PointOutT, NormalT >::refineCorners(), and pcl::search::KdTree< PointT >::setInputCloud().
void pcl::search::KdTree< PointT >::setPointRepresentation | ( | const PointRepresentationConstPtr & | point_representation | ) |
Provide a pointer to the point representation to use to convert points into k-D vectors.
[in] | point_representation | the const boost shared pointer to a PointRepresentation |
Definition at line 54 of file kdtree.hpp.
References pcl::search::KdTree< PointT >::setPointRepresentation().
Referenced by pcl::search::KdTree< PointT >::setPointRepresentation().
void pcl::search::KdTree< PointT >::setSortedResults | ( | bool | sorted_results | ) | [virtual] |
Sets whether the results have to be sorted or not.
[in] | sorted_results | set to true if the radius search results should be sorted |
Reimplemented from pcl::search::Search< PointT >.
Definition at line 62 of file kdtree.hpp.
References pcl::search::KdTree< PointT >::setSortedResults().
Referenced by pcl::search::KdTree< PointT >::setSortedResults().
KdTreeFLANNPtr pcl::search::KdTree< PointT >::tree_ [protected] |
A pointer to the internal KdTreeFLANN object.
Definition at line 171 of file kdtree.h.
Referenced by pcl::search::KdTree< PointTarget >::getEpsilon(), and pcl::search::KdTree< PointTarget >::getPointRepresentation().