Point Cloud Library (PCL)
1.3.1
|
KdTree represents the base spatial locator class for nearest neighbor estimation. More...
#include <pcl/kdtree/kdtree.h>
Public Types | |
typedef pcl::PointCloud< PointT > | PointCloud |
typedef boost::shared_ptr < PointCloud > | PointCloudPtr |
typedef boost::shared_ptr < const PointCloud > | PointCloudConstPtr |
typedef pcl::PointRepresentation < PointT > | PointRepresentation |
typedef boost::shared_ptr < const PointRepresentation > | PointRepresentationConstPtr |
typedef boost::shared_ptr < KdTree< PointT > > | Ptr |
typedef boost::shared_ptr < const KdTree< PointT > > | ConstPtr |
Public Member Functions | |
KdTree (bool sorted=true) | |
Empty constructor for KdTree. | |
virtual void | setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) |
Provide a pointer to the input dataset. | |
IndicesConstPtr const | getIndices () |
Get a pointer to the vector of indices used. | |
PointCloudConstPtr | getInputCloud () |
Get a pointer to the input point cloud dataset. | |
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation) |
Provide a pointer to the point representation to use to convert points into k-D vectors. | |
PointRepresentationConstPtr const | getPointRepresentation () |
Get a pointer to the point representation used when converting points into k-D vectors. | |
virtual | ~KdTree () |
Destructor for KdTree. | |
virtual int | nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)=0 |
Search for k-nearest neighbors for the given query point. | |
virtual int | nearestKSearch (const PointT &p_q, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)=0 |
Search for k-nearest neighbors for the given query point. | |
template<typename PointTDiff > | |
int | nearestKSearchT (const PointTDiff &point, int k, std::vector< int > &k_indices, std::vector< float > &k_distances) |
Search for k-nearest neighbors for the given query point. | |
virtual int | nearestKSearch (int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances)=0 |
Search for k-nearest neighbors for the given query point (zero-copy). | |
virtual 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) const =0 |
Search for all the nearest neighbors of the query point in a given radius. | |
virtual int | radiusSearch (const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, int max_nn=INT_MAX) const =0 |
Search for all the nearest neighbors of the query point in a given radius. | |
template<typename PointTDiff > | |
int | radiusSearchT (const PointTDiff &point, 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. | |
virtual int | radiusSearch (int index, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, int max_nn=INT_MAX) const =0 |
Search for all the nearest neighbors of the query point in a given radius (zero-copy). | |
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 | setMinPts (int min_pts) |
Minimum allowed number of k nearest neighbors points that a viable result must contain. | |
float | getMinPts () |
Get the minimum allowed number of k nearest neighbors points that a viable result must contain. |
KdTree represents the base spatial locator class for nearest neighbor estimation.
All types of spatial locators should inherit from KdTree.
typedef boost::shared_ptr<const KdTree<PointT> > pcl::KdTree::ConstPtr |
Reimplemented in pcl::KdTreeFLANN.
typedef pcl::PointCloud<PointT> pcl::KdTree::PointCloud |
typedef boost::shared_ptr<const PointCloud> pcl::KdTree::PointCloudConstPtr |
typedef boost::shared_ptr<PointCloud> pcl::KdTree::PointCloudPtr |
typedef pcl::PointRepresentation<PointT> pcl::KdTree::PointRepresentation |
typedef boost::shared_ptr<const PointRepresentation> pcl::KdTree::PointRepresentationConstPtr |
typedef boost::shared_ptr<KdTree<PointT> > pcl::KdTree::Ptr |
Reimplemented in pcl::KdTreeFLANN.
pcl::KdTree::KdTree | ( | bool | sorted = true | ) | [inline] |
virtual pcl::KdTree::~KdTree | ( | ) | [inline, virtual] |
double pcl::KdTree::getEpsilon | ( | ) | [inline] |
IndicesConstPtr const pcl::KdTree::getIndices | ( | ) | [inline] |
PointCloudConstPtr pcl::KdTree::getInputCloud | ( | ) | [inline] |
float pcl::KdTree::getMinPts | ( | ) | [inline] |
PointRepresentationConstPtr const pcl::KdTree::getPointRepresentation | ( | ) | [inline] |
virtual int pcl::KdTree::nearestKSearch | ( | const PointCloud & | cloud, |
int | index, | ||
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances | ||
) | [pure virtual] |
Search for k-nearest 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_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
virtual int pcl::KdTree::nearestKSearch | ( | const PointT & | p_q, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances | ||
) | [pure virtual] |
Search for k-nearest neighbors for the given query point.
[in] | p_q | 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_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
Implemented in pcl::KdTreeFLANN.
virtual int pcl::KdTree::nearestKSearch | ( | int | index, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances | ||
) | [pure virtual] |
Search for k-nearest neighbors for the given query point (zero-copy).
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 |
k | the number of neighbors to search for |
k_indices | the resultant indices of the neighboring points (must be resized to k a priori!) |
k_sqr_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
Implemented in pcl::KdTreeFLANN.
int pcl::KdTree::nearestKSearchT | ( | const PointTDiff & | point, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances | ||
) | [inline] |
Search for 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_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
virtual int pcl::KdTree::radiusSearch | ( | const PointCloud & | cloud, |
int | index, | ||
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances, | ||
int | max_nn = INT_MAX |
||
) | const [pure virtual] |
Search for all the nearest neighbors of the query point in a given radius.
[in] | cloud | the point cloud data |
[in] | index | the index in cloud representing the 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_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
virtual int pcl::KdTree::radiusSearch | ( | const PointT & | p_q, |
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances, | ||
int | max_nn = INT_MAX |
||
) | const [pure virtual] |
Search for all the nearest neighbors of the query point in a given radius.
[in] | p_q | 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_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
Implemented in pcl::KdTreeFLANN.
virtual int pcl::KdTree::radiusSearch | ( | int | index, |
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_sqr_distances, | ||
int | max_nn = INT_MAX |
||
) | const [pure virtual] |
Search for all the nearest neighbors of the query point in a given radius (zero-copy).
[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] | 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_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
Implemented in pcl::KdTreeFLANN.
int pcl::KdTree::radiusSearchT | ( | const PointTDiff & | point, |
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances, | ||
int | max_nn = -1 |
||
) | const [inline] |
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_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
void pcl::KdTree::setEpsilon | ( | double | eps | ) | [inline] |
virtual void pcl::KdTree::setInputCloud | ( | const PointCloudConstPtr & | cloud, |
const IndicesConstPtr & | indices = IndicesConstPtr () |
||
) | [inline, 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 - if NULL the whole cloud is used |
void pcl::KdTree::setMinPts | ( | int | min_pts | ) | [inline] |
void pcl::KdTree::setPointRepresentation | ( | const PointRepresentationConstPtr & | point_representation | ) | [inline] |
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 |