|
Point Cloud Library (PCL) 1.15.1
|
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 | |
| using | PointCloud = typename Search<PointT>::PointCloud |
| using | PointCloudConstPtr = typename Search<PointT>::PointCloudConstPtr |
| using | Ptr = shared_ptr<KdTree<PointT, Tree> > |
| using | ConstPtr = shared_ptr<const KdTree<PointT, Tree> > |
| using | KdTreePtr = typename Tree::Ptr |
| using | KdTreeConstPtr = typename Tree::ConstPtr |
| using | PointRepresentationConstPtr = typename PointRepresentation<PointT>::ConstPtr |
| Public Types inherited from pcl::search::Search< PointT > | |
| using | PointCloud = pcl::PointCloud<PointT> |
| using | PointCloudPtr = typename PointCloud::Ptr |
| using | PointCloudConstPtr = typename PointCloud::ConstPtr |
| using | Ptr = shared_ptr<pcl::search::Search<PointT> > |
| using | ConstPtr = shared_ptr<const pcl::search::Search<PointT> > |
| using | IndicesPtr = pcl::IndicesPtr |
| using | IndicesConstPtr = pcl::IndicesConstPtr |
Public Member Functions | |
| KdTree (bool sorted=true) | |
| Constructor for KdTree. | |
| ~KdTree () override=default | |
| 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) override |
| 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. | |
| bool | setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override |
| Provide a pointer to the input dataset. | |
| int | nearestKSearch (const PointT &point, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override |
| Search for the k-nearest neighbors for the given query point. | |
| int | radiusSearch (const PointT &point, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override |
| Search for all the nearest neighbors of the query point in a given radius. | |
| Public Member Functions inherited from pcl::search::Search< PointT > | |
| Search (const std::string &name="", bool sorted=false) | |
| Constructor. | |
| virtual | ~Search ()=default |
| Destructor. | |
| virtual const std::string & | getName () const |
| Returns the search method name. | |
| virtual bool | getSortedResults () |
| Gets whether the results should be sorted (ascending in the distance) or not Otherwise the results may be returned in any order. | |
| virtual PointCloudConstPtr | getInputCloud () const |
| Get a pointer to the input point cloud dataset. | |
| virtual IndicesConstPtr | getIndices () const |
| Get a pointer to the vector of indices used. | |
| template<typename PointTDiff> | |
| int | nearestKSearchT (const PointTDiff &point, 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 (const PointCloud &cloud, index_t index, 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 (index_t index, 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 void | nearestKSearch (const PointCloud &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const |
| Search for the k-nearest neighbors for the given query point. | |
| template<typename PointTDiff> | |
| void | nearestKSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, int k, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const |
| Search for the k-nearest neighbors for the given query point. | |
| 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 (const PointCloud &cloud, index_t 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. | |
| virtual int | radiusSearch (index_t 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 | radiusSearch (const PointCloud &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< 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> | |
| void | radiusSearchT (const pcl::PointCloud< PointTDiff > &cloud, const Indices &indices, double radius, std::vector< Indices > &k_indices, std::vector< std::vector< float > > &k_sqr_distances, unsigned int max_nn=0) const |
| Search for all the nearest neighbors of the query points in a given radius. | |
Protected Member Functions | |
| KdTree (const std::string &name, bool sorted) | |
| This leaves the internal tree_ object uninitialized! | |
| Protected Member Functions inherited from pcl::search::Search< PointT > | |
| void | sortResults (Indices &indices, std::vector< float > &distances) const |
Protected Attributes | |
| KdTreePtr | tree_ |
| A pointer to the internal KdTree object. | |
| Protected Attributes inherited from pcl::search::Search< PointT > | |
| PointCloudConstPtr | input_ |
| IndicesConstPtr | indices_ |
| bool | sorted_results_ |
| std::string | name_ |
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.
| using pcl::search::KdTree< PointT, Tree >::ConstPtr = shared_ptr<const KdTree<PointT, Tree> > |
| using pcl::search::KdTree< PointT, Tree >::KdTreeConstPtr = typename Tree::ConstPtr |
| using pcl::search::KdTree< PointT, Tree >::KdTreePtr = typename Tree::Ptr |
| using pcl::search::KdTree< PointT, Tree >::PointCloud = typename Search<PointT>::PointCloud |
| using pcl::search::KdTree< PointT, Tree >::PointCloudConstPtr = typename Search<PointT>::PointCloudConstPtr |
| using pcl::search::KdTree< PointT, Tree >::PointRepresentationConstPtr = typename PointRepresentation<PointT>::ConstPtr |
| using pcl::search::KdTree< PointT, Tree >::Ptr = shared_ptr<KdTree<PointT, Tree> > |
| pcl::search::KdTree< PointT, Tree >::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 45 of file kdtree.hpp.
References pcl::search::Search< PointT >::Search(), and tree_.
Referenced by pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >::KdTreeNanoflann().
|
overridedefault |
Destructor for KdTree.
|
protected |
This leaves the internal tree_ object uninitialized!
Definition at line 52 of file kdtree.hpp.
References pcl::search::Search< PointT >::Search().
|
inline |
|
inline |
|
overridevirtual |
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 >.
Reimplemented in pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >.
Definition at line 100 of file kdtree.hpp.
References tree_.
Referenced by pcl::GeneralizedIterativeClosestPoint< PointSource, PointTarget, Scalar >::computeCovariances(), pcl::registration::FPCSInitialAlignment< PointSource, PointTarget, pcl::Normal, float >::FPCSInitialAlignment(), and pcl::getMeanPointDensity().
|
overridevirtual |
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 >.
Reimplemented in pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >.
Definition at line 109 of file kdtree.hpp.
| void pcl::search::KdTree< PointT, Tree >::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 78 of file kdtree.hpp.
References tree_.
|
overridevirtual |
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 >.
Reimplemented in pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >.
Definition at line 88 of file kdtree.hpp.
Referenced by pcl::people::GroundBasedPeopleDetectionApp< PointT >::compute(), pcl::getMeanPointDensity(), and pcl::getMeanPointDensity().
| void pcl::search::KdTree< PointT, Tree >::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 59 of file kdtree.hpp.
References tree_.
|
overridevirtual |
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 >.
Reimplemented in pcl::search::KdTreeNanoflann< PointT, Dim, Distance, L2_Adaptor, L2_Simple_Adaptor, Tree >.
Definition at line 70 of file kdtree.hpp.
References pcl::search::Search< PointT >::sorted_results_, and tree_.
|
protected |
A pointer to the internal KdTree object.
Definition at line 167 of file kdtree.h.
Referenced by KdTree(), nearestKSearch(), setEpsilon(), setPointRepresentation(), and setSortedResults().