Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions
pcl::KdTreeFLANN< Eigen::MatrixXf > Class Template Reference

KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures. More...

#include <pcl/kdtree/kdtree_flann.h>

List of all members.

Public Types

typedef pcl::PointCloud
< Eigen::MatrixXf > 
PointCloud
typedef PointCloud::ConstPtr PointCloudConstPtr
typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr
typedef boost::shared_ptr
< const std::vector< int > > 
IndicesConstPtr
typedef flann::Index
< flann::L2_Simple< float > > 
FLANNIndex
typedef
pcl::PointRepresentation
< Eigen::MatrixXf > 
PointRepresentation
typedef boost::shared_ptr
< const PointRepresentation
PointRepresentationConstPtr
typedef boost::shared_ptr
< KdTreeFLANN< Eigen::MatrixXf > > 
Ptr
typedef boost::shared_ptr
< const KdTreeFLANN
< Eigen::MatrixXf > > 
ConstPtr

Public Member Functions

 KdTreeFLANN (bool sorted=true)
 Default Constructor for KdTreeFLANN.
 KdTreeFLANN (const KdTreeFLANN< Eigen::MatrixXf > &k)
 Copy constructor.
KdTreeFLANNoperator= (const KdTreeFLANN< Eigen::MatrixXf > &k)
 Copy operator.
void setEpsilon (float eps)
 Set the search epsilon precision (error bound) for nearest neighbors searches.
Ptr makeShared ()
virtual ~KdTreeFLANN ()
 Destructor for KdTreeFLANN.
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.
template<typename T >
int nearestKSearch (const T &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 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_sqr_distances) const
 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_sqr_distances) const
 Search for k-nearest neighbors for the given query point (zero-copy).
template<typename T >
int radiusSearch (const T &point, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_dists, unsigned int max_nn=0) 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_sqr_distances, unsigned int max_nn=0) 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_sqr_distances, unsigned int max_nn=0) const
 Search for all the nearest neighbors of the query point in a given radius (zero-copy).
float getEpsilon () const
 Get the search epsilon precision (error bound) for nearest neighbors searches.

Detailed Description

template<>
class pcl::KdTreeFLANN< Eigen::MatrixXf >

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.

Author:
Radu B. Rusu, Marius Muja

Definition at line 258 of file kdtree_flann.h.


Member Typedef Documentation

typedef boost::shared_ptr<const KdTreeFLANN<Eigen::MatrixXf> > pcl::KdTreeFLANN< Eigen::MatrixXf >::ConstPtr

Definition at line 274 of file kdtree_flann.h.

typedef flann::Index<flann::L2_Simple<float> > pcl::KdTreeFLANN< Eigen::MatrixXf >::FLANNIndex

Definition at line 267 of file kdtree_flann.h.

typedef boost::shared_ptr<const std::vector<int> > pcl::KdTreeFLANN< Eigen::MatrixXf >::IndicesConstPtr

Definition at line 265 of file kdtree_flann.h.

typedef boost::shared_ptr<std::vector<int> > pcl::KdTreeFLANN< Eigen::MatrixXf >::IndicesPtr

Definition at line 264 of file kdtree_flann.h.

typedef pcl::PointCloud<Eigen::MatrixXf> pcl::KdTreeFLANN< Eigen::MatrixXf >::PointCloud

Definition at line 261 of file kdtree_flann.h.

Definition at line 262 of file kdtree_flann.h.

typedef pcl::PointRepresentation<Eigen::MatrixXf> pcl::KdTreeFLANN< Eigen::MatrixXf >::PointRepresentation

Definition at line 269 of file kdtree_flann.h.

typedef boost::shared_ptr<const PointRepresentation> pcl::KdTreeFLANN< Eigen::MatrixXf >::PointRepresentationConstPtr

Definition at line 270 of file kdtree_flann.h.

typedef boost::shared_ptr<KdTreeFLANN<Eigen::MatrixXf> > pcl::KdTreeFLANN< Eigen::MatrixXf >::Ptr

Definition at line 273 of file kdtree_flann.h.


Constructor & Destructor Documentation

pcl::KdTreeFLANN< Eigen::MatrixXf >::KdTreeFLANN ( bool  sorted = true) [inline]

Default Constructor for KdTreeFLANN.

Parameters:
[in]sortedset 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 281 of file kdtree_flann.h.

pcl::KdTreeFLANN< Eigen::MatrixXf >::KdTreeFLANN ( const KdTreeFLANN< Eigen::MatrixXf > &  k) [inline]

Copy constructor.

Parameters:
[in]treethe tree to copy into this

Definition at line 294 of file kdtree_flann.h.

virtual pcl::KdTreeFLANN< Eigen::MatrixXf >::~KdTreeFLANN ( ) [inline, virtual]

Destructor for KdTreeFLANN.

Deletes all allocated data arrays and destroys the kd-tree structures.

Definition at line 342 of file kdtree_flann.h.


Member Function Documentation

float pcl::KdTreeFLANN< Eigen::MatrixXf >::getEpsilon ( ) const [inline]

Get the search epsilon precision (error bound) for nearest neighbors searches.

Definition at line 591 of file kdtree_flann.h.

IndicesConstPtr pcl::KdTreeFLANN< Eigen::MatrixXf >::getIndices ( ) const [inline]

Get a pointer to the vector of indices used.

Definition at line 384 of file kdtree_flann.h.

PointCloudConstPtr pcl::KdTreeFLANN< Eigen::MatrixXf >::getInputCloud ( ) const [inline]

Get a pointer to the input point cloud dataset.

Definition at line 391 of file kdtree_flann.h.

Ptr pcl::KdTreeFLANN< Eigen::MatrixXf >::makeShared ( ) [inline]

Definition at line 337 of file kdtree_flann.h.

template<typename T >
int pcl::KdTreeFLANN< Eigen::MatrixXf >::nearestKSearch ( const T &  point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline]

Search for k-nearest neighbors for the given query point.

Parameters:
[in]pointthe given query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Definition at line 405 of file kdtree_flann.h.

int pcl::KdTreeFLANN< Eigen::MatrixXf >::nearestKSearch ( const PointCloud cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline]

Search for k-nearest neighbors for the given query point.

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Definition at line 454 of file kdtree_flann.h.

int pcl::KdTreeFLANN< Eigen::MatrixXf >::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const [inline]

Search for k-nearest neighbors for the given query point (zero-copy).

Parameters:
[in]indexthe 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]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points (must be resized to k a priori!)
[out]k_sqr_distancesthe resultant squared distances to the neighboring points (must be resized to k a priori!)
Returns:
number of neighbors found

Definition at line 471 of file kdtree_flann.h.

KdTreeFLANN& pcl::KdTreeFLANN< Eigen::MatrixXf >::operator= ( const KdTreeFLANN< Eigen::MatrixXf > &  k) [inline]

Copy operator.

Parameters:
[in]treethe tree to copy into this

Definition at line 308 of file kdtree_flann.h.

template<typename T >
int pcl::KdTreeFLANN< Eigen::MatrixXf >::radiusSearch ( const T &  point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_dists,
unsigned int  max_nn = 0 
) const [inline]

Search for all the nearest neighbors of the query point in a given radius.

Parameters:
[in]pointthe given query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_sqr_diststhe resultant squared distances to the neighboring points
[in]max_nnif 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.
Returns:
number of neighbors found in radius

Definition at line 497 of file kdtree_flann.h.

int pcl::KdTreeFLANN< Eigen::MatrixXf >::radiusSearch ( const PointCloud cloud,
int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const [inline]

Search for all the nearest neighbors of the query point in a given radius.

Parameters:
[in]cloudthe point cloud data
[in]indexthe index in cloud representing the query point
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_sqr_distancesthe resultant squared distances to the neighboring points
[in]max_nnif 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.
Returns:
number of neighbors found in radius

Definition at line 554 of file kdtree_flann.h.

int pcl::KdTreeFLANN< Eigen::MatrixXf >::radiusSearch ( int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const [inline]

Search for all the nearest neighbors of the query point in a given radius (zero-copy).

Parameters:
[in]indexthe 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]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points
[out]k_sqr_distancesthe resultant squared distances to the neighboring points
[in]max_nnif 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.
Returns:
number of neighbors found in radius

Definition at line 574 of file kdtree_flann.h.

void pcl::KdTreeFLANN< Eigen::MatrixXf >::setEpsilon ( float  eps) [inline]

Set the search epsilon precision (error bound) for nearest neighbors searches.

Parameters:
[in]epsprecision (error bound) for nearest neighbors searches

Definition at line 329 of file kdtree_flann.h.

void pcl::KdTreeFLANN< Eigen::MatrixXf >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices = IndicesConstPtr () 
) [inline]

Provide a pointer to the input dataset.

Parameters:
[in]cloudthe const boost shared pointer to a PointCloud message
[in]indicesthe point indices subset that is to be used from cloud - if NULL the whole cloud is used

Definition at line 352 of file kdtree_flann.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines