|
Point Cloud Library (PCL) 1.12.1
|
KdTree represents the base spatial locator class for kd-tree implementations. More...
#include <pcl/kdtree/kdtree.h>
Public Types | |
| using | IndicesPtr = shared_ptr<Indices > |
| using | IndicesConstPtr = shared_ptr<const Indices > |
| using | PointCloud = pcl::PointCloud<PointT> |
| using | PointCloudPtr = typename PointCloud::Ptr |
| using | PointCloudConstPtr = typename PointCloud::ConstPtr |
| using | PointRepresentation = pcl::PointRepresentation<PointT> |
| using | PointRepresentationConstPtr = typename PointRepresentation::ConstPtr |
| using | Ptr = shared_ptr<KdTree<PointT> > |
| using | ConstPtr = shared_ptr<const KdTree<PointT> > |
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 | getIndices () const |
| Get a pointer to the vector of indices used. | |
| PointCloudConstPtr | getInputCloud () const |
| 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 | getPointRepresentation () const |
| Get a pointer to the point representation used when converting points into k-D vectors. | |
| virtual | ~KdTree () |
| Destructor for KdTree. | |
| virtual int | nearestKSearch (const PointT &p_q, unsigned int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const =0 |
| Search for k-nearest neighbors for the given query point. | |
| virtual int | nearestKSearch (const PointCloud &cloud, int index, unsigned int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const |
| Search for k-nearest neighbors for the given query point. | |
| template<typename PointTDiff> | |
| int | nearestKSearchT (const PointTDiff &point, unsigned int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const |
| Search for k-nearest neighbors for the given query point. | |
| virtual int | nearestKSearch (int index, unsigned int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const |
| Search for k-nearest neighbors for the given query point (zero-copy). | |
| virtual int | radiusSearch (const PointT &p_q, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const =0 |
| Search for all the nearest neighbors of the query point in a given radius. | |
| virtual int | radiusSearch (const PointCloud &cloud, int index, double radius, Indices &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. | |
| template<typename PointTDiff> | |
| int | radiusSearchT (const PointTDiff &point, double radius, Indices &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. | |
| virtual int | radiusSearch (int index, double radius, Indices &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 (zero-copy). | |
| virtual 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 | setMinPts (int min_pts) |
| Minimum allowed number of k nearest neighbors points that a viable result must contain. | |
| int | getMinPts () const |
| Get the minimum allowed number of k nearest neighbors points that a viable result must contain. | |
Protected Member Functions | |
| virtual std::string | getName () const =0 |
| Class getName method. | |
Protected Attributes | |
| PointCloudConstPtr | input_ |
| The input point cloud dataset containing the points we need to use. | |
| IndicesConstPtr | indices_ |
| A pointer to the vector of point indices to use. | |
| float | epsilon_ |
| Epsilon precision (error bound) for nearest neighbors searches. | |
| int | min_pts_ |
| Minimum allowed number of k nearest neighbors points that a viable result must contain. | |
| bool | sorted_ |
| Return the radius search neighbours sorted. | |
| PointRepresentationConstPtr | point_representation_ |
| For converting different point structures into k-dimensional vectors for nearest-neighbor search. | |
KdTree represents the base spatial locator class for kd-tree implementations.
| using pcl::KdTree< PointT >::ConstPtr = shared_ptr<const KdTree<PointT> > |
| using pcl::KdTree< PointT >::IndicesConstPtr = shared_ptr<const Indices > |
| using pcl::KdTree< PointT >::IndicesPtr = shared_ptr<Indices > |
| using pcl::KdTree< PointT >::PointCloud = pcl::PointCloud<PointT> |
| using pcl::KdTree< PointT >::PointCloudConstPtr = typename PointCloud::ConstPtr |
| using pcl::KdTree< PointT >::PointCloudPtr = typename PointCloud::Ptr |
| using pcl::KdTree< PointT >::PointRepresentation = pcl::PointRepresentation<PointT> |
| using pcl::KdTree< PointT >::PointRepresentationConstPtr = typename PointRepresentation::ConstPtr |
| using pcl::KdTree< PointT >::Ptr = shared_ptr<KdTree<PointT> > |
|
inline |
Empty constructor for KdTree.
Sets some internal values to their defaults.
| [in] | sorted | set to true if the application that the tree will be used for requires sorted nearest neighbor indices (default). False otherwise. |
Definition at line 74 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN(), pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN(), and pcl::KdTreeFLANN< PointT, Dist >::operator=().
|
inlinevirtual |
|
inline |
|
inline |
Get a pointer to the vector of indices used.
Definition at line 93 of file kdtree.h.
Referenced by pcl::extractEuclideanClusters().
|
inline |
Get a pointer to the input point cloud dataset.
Definition at line 100 of file kdtree.h.
Referenced by pcl::extractEuclideanClusters(), and pcl::extractEuclideanClusters().
|
inline |
|
protectedpure virtual |
Class getName method.
|
inline |
|
inlinevirtual |
Search for k-nearest neighbors for the given query point.
| [in] | cloud | the point cloud data |
| [in] | index | a valid index in cloud representing a valid (i.e., finite) 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!) |
| asserts | in debug mode if the index is not between 0 and the maximum number of points |
|
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_sqr_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
Implemented in pcl::KdTreeFLANN< PointT, Dist >, pcl::KdTreeFLANN< FeatureT >, pcl::KdTreeFLANN< pcl::InterestPoint >, pcl::KdTreeFLANN< pcl::PointXYZLAB >, pcl::KdTreeFLANN< pcl::PointXYZRGB >, pcl::KdTreeFLANN< pcl::VFHSignature308 >, pcl::KdTreeFLANN< PointTarget >, and pcl::KdTreeFLANN< SceneT >.
|
inlinevirtual |
Search for k-nearest neighbors for the given query point (zero-copy).
| [in] | index | a valid index representing a valid 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!) |
| asserts | in debug mode if the index is not between 0 and the maximum number of points |
|
inline |
Search for k-nearest neighbors for the given query point.
This method accepts a different template parameter for the point type.
| [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!) |
Definition at line 172 of file kdtree.h.
Referenced by pcl::getApproximateIndices().
|
inlinevirtual |
Search for all the nearest neighbors of the query point in a given radius.
| [in] | cloud | the point cloud data |
| [in] | index | a valid index in cloud representing a valid (i.e., finite) 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. |
| asserts | in debug mode if the index is not between 0 and the maximum number of points |
|
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_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. |
Implemented in pcl::KdTreeFLANN< PointT, Dist >, pcl::KdTreeFLANN< FeatureT >, pcl::KdTreeFLANN< pcl::InterestPoint >, pcl::KdTreeFLANN< pcl::PointXYZLAB >, pcl::KdTreeFLANN< pcl::PointXYZRGB >, pcl::KdTreeFLANN< pcl::VFHSignature308 >, pcl::KdTreeFLANN< PointTarget >, and pcl::KdTreeFLANN< SceneT >.
Referenced by pcl::extractEuclideanClusters(), pcl::extractEuclideanClusters(), and pcl::KdTree< PointInT >::radiusSearch().
|
inlinevirtual |
Search for all the nearest neighbors of the query point in a given radius (zero-copy).
| [in] | index | a valid index representing a valid 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_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. |
| asserts | in debug mode if the index is not between 0 and the maximum number of points |
|
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_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. |
|
inlinevirtual |
Set the search epsilon precision (error bound) for nearest neighbors searches.
| [in] | eps | precision (error bound) for nearest neighbors searches |
Reimplemented in pcl::KdTreeFLANN< PointT, Dist >, pcl::KdTreeFLANN< FeatureT >, pcl::KdTreeFLANN< pcl::InterestPoint >, pcl::KdTreeFLANN< pcl::PointXYZLAB >, pcl::KdTreeFLANN< pcl::PointXYZRGB >, pcl::KdTreeFLANN< pcl::VFHSignature308 >, pcl::KdTreeFLANN< PointTarget >, and pcl::KdTreeFLANN< SceneT >.
|
inlinevirtual |
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 |
Reimplemented in pcl::KdTreeFLANN< PointT, Dist >, pcl::KdTreeFLANN< FeatureT >, pcl::KdTreeFLANN< pcl::InterestPoint >, pcl::KdTreeFLANN< pcl::PointXYZLAB >, pcl::KdTreeFLANN< pcl::PointXYZRGB >, pcl::KdTreeFLANN< pcl::VFHSignature308 >, pcl::KdTreeFLANN< PointTarget >, and pcl::KdTreeFLANN< SceneT >.
Definition at line 85 of file kdtree.h.
Referenced by pcl::KdTree< PointInT >::setPointRepresentation().
|
inline |
|
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 |
|
protected |
Epsilon precision (error bound) for nearest neighbors searches.
Definition at line 342 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN(), pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN(), pcl::KdTreeFLANN< PointT, Dist >::setEpsilon(), pcl::KdTreeFLANN< PointT, Dist >::setInputCloud(), and pcl::KdTreeFLANN< PointT, Dist >::setSortedResults().
|
protected |
A pointer to the vector of point indices to use.
Definition at line 339 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::setInputCloud().
|
protected |
The input point cloud dataset containing the points we need to use.
Definition at line 336 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::setInputCloud().
|
protected |
|
protected |
For converting different point structures into k-dimensional vectors for nearest-neighbor search.
Definition at line 351 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::nearestKSearch(), pcl::KdTreeFLANN< PointT, Dist >::radiusSearch(), and pcl::KdTreeFLANN< PointT, Dist >::setInputCloud().
|
protected |
Return the radius search neighbours sorted.
Definition at line 348 of file kdtree.h.
Referenced by pcl::KdTreeFLANN< PointT, Dist >::setEpsilon(), and pcl::KdTreeFLANN< PointT, Dist >::setSortedResults().