Point Cloud Library (PCL)
1.3.1
|
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures. More...
#include <pcl/kdtree/kdtree_flann.h>
Public Types | |
typedef boost::shared_ptr < KdTreeFLANN< PointT > > | Ptr |
typedef boost::shared_ptr < const KdTreeFLANN< PointT > > | ConstPtr |
typedef boost::shared_ptr < PointCloud > | PointCloudPtr |
typedef pcl::PointRepresentation < PointT > | PointRepresentation |
typedef boost::shared_ptr < const PointRepresentation > | PointRepresentationConstPtr |
Public Member Functions | |
KdTreeFLANN (bool sorted=true) | |
Default Constructor for KdTreeFLANN. | |
KdTreeFLANN (KdTreeFLANN &tree) | |
Copy constructor. | |
Ptr | makeShared () |
KdTreeFLANN & | operator= (const KdTreeFLANN &tree) |
void | shallowCopy (const KdTreeFLANN &tree) |
Perform a shallow copy of the tree. | |
virtual | ~KdTreeFLANN () |
Destructor for KdTreeFLANN. | |
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_distances) |
Search for 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 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 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_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) const |
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=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 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. | |
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 | 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. | |
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. | |
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. |
KdTreeFLANN 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 KdTreeFLANN<PointT> > pcl::KdTreeFLANN::ConstPtr |
Reimplemented from pcl::KdTree< PointT >.
Definition at line 84 of file kdtree_flann.h.
typedef boost::shared_ptr<PointCloud> pcl::KdTree::PointCloudPtr [inherited] |
typedef pcl::PointRepresentation<PointT> pcl::KdTree::PointRepresentation [inherited] |
typedef boost::shared_ptr<const PointRepresentation> pcl::KdTree::PointRepresentationConstPtr [inherited] |
typedef boost::shared_ptr<KdTreeFLANN<PointT> > pcl::KdTreeFLANN::Ptr |
Reimplemented from pcl::KdTree< PointT >.
Definition at line 83 of file kdtree_flann.h.
pcl::KdTreeFLANN::KdTreeFLANN | ( | bool | sorted = true | ) | [inline] |
Default Constructor for KdTreeFLANN.
[in] | sorted | set to true if the application that the tree will be used for requires sorted nearest neighbor indices (default). False otherwise. |
By setting sorted to false, the radiusSearch operations will be faster.
Definition at line 91 of file kdtree_flann.h.
pcl::KdTreeFLANN::KdTreeFLANN | ( | KdTreeFLANN & | tree | ) | [inline] |
Copy constructor.
This copy constructor does shallow copy of the tree, the only reason why it's needed is because boost::mutex is non-copyable, so the default copy constructor would not work
[in] | tree | the tree to copy |
Definition at line 104 of file kdtree_flann.h.
virtual pcl::KdTreeFLANN::~KdTreeFLANN | ( | ) | [inline, virtual] |
Destructor for KdTreeFLANN.
Deletes all allocated data arrays and destroys the kd-tree structures.
Definition at line 138 of file kdtree_flann.h.
double pcl::KdTree::getEpsilon | ( | ) | [inline, inherited] |
IndicesConstPtr const pcl::KdTree::getIndices | ( | ) | [inline, inherited] |
PointCloudConstPtr pcl::KdTree::getInputCloud | ( | ) | [inline, inherited] |
float pcl::KdTree::getMinPts | ( | ) | [inline, inherited] |
PointRepresentationConstPtr const pcl::KdTree::getPointRepresentation | ( | ) | [inline, inherited] |
Ptr pcl::KdTreeFLANN::makeShared | ( | ) | [inline] |
Definition at line 109 of file kdtree_flann.h.
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, inherited] |
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!) |
int pcl::KdTreeFLANN::nearestKSearch | ( | const PointT & | point, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances | ||
) | [virtual] |
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!) |
Implements pcl::KdTree< PointT >.
Definition at line 76 of file kdtree_flann.hpp.
int pcl::KdTreeFLANN::nearestKSearch | ( | const PointCloud & | cloud, |
int | index, | ||
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances | ||
) | [inline] |
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!) |
Definition at line 172 of file kdtree_flann.h.
int pcl::KdTreeFLANN::nearestKSearch | ( | int | index, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances | ||
) | [inline, virtual] |
Search for k-nearest neighbors for the given query point (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] | 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!) |
Implements pcl::KdTree< PointT >.
Definition at line 190 of file kdtree_flann.h.
int pcl::KdTree::nearestKSearchT | ( | const PointTDiff & | point, |
int | k, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances | ||
) | [inline, inherited] |
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!) |
KdTreeFLANN& pcl::KdTreeFLANN::operator= | ( | const KdTreeFLANN & | tree | ) | [inline] |
Definition at line 111 of file kdtree_flann.h.
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, inherited] |
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 |
int pcl::KdTreeFLANN::radiusSearch | ( | const PointT & | point, |
double | radius, | ||
std::vector< int > & | k_indices, | ||
std::vector< float > & | k_distances, | ||
int | max_nn = -1 |
||
) | 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_distances | the resultant squared distances to the neighboring points |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
Implements pcl::KdTree< PointT >.
Definition at line 113 of file kdtree_flann.hpp.
int pcl::KdTreeFLANN::radiusSearch | ( | const PointCloud & | cloud, |
int | index, | ||
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] | 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 |
Definition at line 229 of file kdtree_flann.h.
int pcl::KdTreeFLANN::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).
[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 |
Implements pcl::KdTree< PointT >.
Definition at line 248 of file kdtree_flann.h.
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, inherited] |
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, inherited] |
virtual void pcl::KdTree::setInputCloud | ( | const PointCloudConstPtr & | cloud, |
const IndicesConstPtr & | indices = IndicesConstPtr () |
||
) | [inline, virtual, inherited] |
void pcl::KdTreeFLANN::setInputCloud | ( | const PointCloudConstPtr & | cloud, |
const IndicesConstPtr & | indices = IndicesConstPtr () |
||
) |
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 |
Definition at line 45 of file kdtree_flann.hpp.
void pcl::KdTree::setMinPts | ( | int | min_pts | ) | [inline, inherited] |
void pcl::KdTree::setPointRepresentation | ( | const PointRepresentationConstPtr & | point_representation | ) | [inline, inherited] |
void pcl::KdTreeFLANN::shallowCopy | ( | const KdTreeFLANN & | tree | ) | [inline] |
Perform a shallow copy of the tree.
[in] | tree | the tree to copy |
Definition at line 125 of file kdtree_flann.h.