pcl::KdTreeFLANN< PointT, Dist > Class Template Reference
[Module kdtree]

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

#include <pcl/kdtree/kdtree_flann.h>

Inheritance diagram for pcl::KdTreeFLANN< PointT, Dist >:
Inheritance graph
[legend]
Collaboration diagram for pcl::KdTreeFLANN< PointT, Dist >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef KdTree< PointT >
::PointCloud 
PointCloud
typedef KdTree< PointT >
::PointCloudConstPtr 
PointCloudConstPtr
typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr
typedef boost::shared_ptr
< const std::vector< int > > 
IndicesConstPtr
typedef ::flann::Index< Dist > FLANNIndex
typedef boost::shared_ptr
< KdTreeFLANN< PointT > > 
Ptr
typedef boost::shared_ptr
< const KdTreeFLANN< PointT > > 
ConstPtr

Public Member Functions

 KdTreeFLANN (bool sorted=true)
 Default Constructor for KdTreeFLANN.
 KdTreeFLANN (const KdTreeFLANN< PointT > &k)
 Copy constructor.
KdTreeFLANN< PointT > & operator= (const KdTreeFLANN< PointT > &k)
 Copy operator.
void setEpsilon (float eps)
 Set the search epsilon precision (error bound) for nearest neighbors searches.
void setSortedResults (bool sorted)
Ptr makeShared ()
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_sqr_distances) const
 Search for k-nearest neighbors for the given query point.
int radiusSearch (const PointT &point, 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.

Detailed Description

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
class pcl::KdTreeFLANN< PointT, Dist >

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 67 of file kdtree_flann.h.


Member Typedef Documentation

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef boost::shared_ptr<const KdTreeFLANN<PointT> > pcl::KdTreeFLANN< PointT, Dist >::ConstPtr

Reimplemented from pcl::KdTree< PointT >.

Definition at line 88 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef ::flann::Index<Dist> pcl::KdTreeFLANN< PointT, Dist >::FLANNIndex

Definition at line 84 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef boost::shared_ptr<const std::vector<int> > pcl::KdTreeFLANN< PointT, Dist >::IndicesConstPtr

Reimplemented from pcl::KdTree< PointT >.

Definition at line 82 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef boost::shared_ptr<std::vector<int> > pcl::KdTreeFLANN< PointT, Dist >::IndicesPtr

Reimplemented from pcl::KdTree< PointT >.

Definition at line 81 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef KdTree<PointT>::PointCloud pcl::KdTreeFLANN< PointT, Dist >::PointCloud

Reimplemented from pcl::KdTree< PointT >.

Definition at line 78 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef KdTree<PointT>::PointCloudConstPtr pcl::KdTreeFLANN< PointT, Dist >::PointCloudConstPtr

Reimplemented from pcl::KdTree< PointT >.

Definition at line 79 of file kdtree_flann.h.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
typedef boost::shared_ptr<KdTreeFLANN<PointT> > pcl::KdTreeFLANN< PointT, Dist >::Ptr

Reimplemented from pcl::KdTree< PointT >.

Definition at line 87 of file kdtree_flann.h.


Constructor & Destructor Documentation

template<typename PointT , typename Dist >
pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN ( bool  sorted = true  )  [inline]

Default Constructor for KdTreeFLANN.

Parameters:
[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 49 of file kdtree_flann.hpp.

template<typename PointT, typename Dist >
pcl::KdTreeFLANN< PointT, Dist >::KdTreeFLANN ( const KdTreeFLANN< PointT > &  k  )  [inline]

Copy constructor.

Parameters:
[in] tree the tree to copy into this

Definition at line 61 of file kdtree_flann.hpp.

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
virtual pcl::KdTreeFLANN< PointT, Dist >::~KdTreeFLANN (  )  [inline, virtual]

Destructor for KdTreeFLANN.

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

Definition at line 134 of file kdtree_flann.h.


Member Function Documentation

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
Ptr pcl::KdTreeFLANN< PointT, Dist >::makeShared (  )  [inline]

Definition at line 129 of file kdtree_flann.h.

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

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

Attention:
This method does not do any bounds checking for the input index (i.e., index >= cloud.points.size () || index < 0), and assumes valid (i.e., finite) data.
Parameters:
[in] point a given 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!)
Returns:
number of neighbors found
Exceptions:
asserts in debug mode if the index is not between 0 and the maximum number of points

Implements pcl::KdTree< PointT >.

Definition at line 132 of file kdtree_flann.hpp.

References pcl::KdTree< PointT >::point_representation_.

Referenced by pcl::StatisticalMultiscaleInterestRegionExtraction< PointT >::generateCloudGraph(), pcl::getApproximateIndices(), pcl::VoxelGridCovariance< PointTarget >::nearestKSearch(), pcl::ConcaveHull< PointInT >::performReconstruction(), ObjectRecognition::recognizeAndAlignPoints(), and ObjectRecognition::recognizeObject().

template<typename PointT, typename Dist = ::flann::L2_Simple<float>>
KdTreeFLANN<PointT>& pcl::KdTreeFLANN< PointT, Dist >::operator= ( const KdTreeFLANN< PointT > &  k  )  [inline]

Copy operator.

Parameters:
[in] tree the tree to copy into this

Definition at line 106 of file kdtree_flann.h.

Referenced by pcl::KdTreeFLANN< GlobalDescriptorT >::operator=().

template<typename PointT, typename Dist >
int pcl::KdTreeFLANN< PointT, Dist >::radiusSearch ( const PointT point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const [inline, virtual]

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

Attention:
This method does not do any bounds checking for the input index (i.e., index >= cloud.points.size () || index < 0), and assumes valid (i.e., finite) data.
Parameters:
[in] point a given 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.
Returns:
number of neighbors found in radius
Exceptions:
asserts in debug mode if the index is not between 0 and the maximum number of points

Implements pcl::KdTree< PointT >.

Definition at line 169 of file kdtree_flann.hpp.

References pcl::KdTree< PointT >::point_representation_.

Referenced by pcl::features::ISMVoteList< PointT >::getDensityAtPoint(), pcl::VoxelGridCovariance< PointTarget >::radiusSearch(), pcl::features::ISMVoteList< PointT >::shiftMean(), and pcl::TextureMapping< PointInT >::textureMeshwithMultipleCameras().

template<typename PointT , typename Dist >
void pcl::KdTreeFLANN< PointT, Dist >::setEpsilon ( float  eps  )  [inline, virtual]

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

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

Reimplemented from pcl::KdTree< PointT >.

Definition at line 74 of file kdtree_flann.hpp.

References pcl::KdTree< PointT >::epsilon_, and pcl::KdTree< PointT >::sorted_.

template<typename PointT , typename Dist >
void pcl::KdTreeFLANN< PointT, Dist >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices = IndicesConstPtr () 
) [inline, virtual]
template<typename PointT , typename Dist >
void pcl::KdTreeFLANN< PointT, Dist >::setSortedResults ( bool  sorted  )  [inline]

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