Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Public Attributes
pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT > Class Template Reference

search::Octree is a wrapper class which implements nearest neighbor search operations based on the pcl::octree::Octree structure. More...

#include <pcl/search/octree.h>

Inheritance diagram for pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >:
Inheritance graph
[legend]
Collaboration diagram for pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >:
Collaboration graph
[legend]

Public Types

typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr
 
typedef boost::shared_ptr
< const std::vector< int > > 
IndicesConstPtr
 
typedef pcl::PointCloud< PointTPointCloud
 
typedef boost::shared_ptr
< PointCloud
PointCloudPtr
 
typedef boost::shared_ptr
< const PointCloud
PointCloudConstPtr
 
typedef boost::shared_ptr
< pcl::octree::OctreePointCloudSearch
< PointT, LeafTWrap,
BranchTWrap > > 
Ptr
 
typedef boost::shared_ptr
< const
pcl::octree::OctreePointCloudSearch
< PointT, LeafTWrap,
BranchTWrap > > 
ConstPtr
 

Public Member Functions

 Octree (const double resolution)
 Octree constructor. More...
 
virtual ~Octree ()
 Empty Destructor. More...
 
void setInputCloud (const PointCloudConstPtr &cloud)
 Provide a pointer to the input dataset. More...
 
void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices)
 Provide a pointer to the input dataset. More...
 
int nearestKSearch (const PointCloud &cloud, int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point. More...
 
int nearestKSearch (const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point. More...
 
int nearestKSearch (int index, int k, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point (zero-copy). More...
 
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 neighbors of query point that are within a given radius. More...
 
int radiusSearch (const PointT &p_q, double radius, std::vector< int > &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const
 search for all neighbors of query point that are within a given radius. More...
 
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 neighbors of query point that are within a given radius. More...
 
void approxNearestSearch (const PointCloudConstPtr &cloud, int query_index, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point. More...
 
void approxNearestSearch (const PointT &p_q, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point. More...
 
void approxNearestSearch (int query_index, int &result_index, float &sqr_distance)
 Search for approximate nearest neighbor at the query point. More...
 
virtual const std::string & getName () const
 returns the search method name More...
 
virtual void setSortedResults (bool sorted)
 sets whether the results should be sorted (ascending in the distance) or not More...
 
virtual void setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
 Pass the input dataset that the search will be performed on. More...
 
virtual PointCloudConstPtr getInputCloud () const
 Get a pointer to the input point cloud dataset. More...
 
virtual IndicesConstPtr getIndices () const
 Get a pointer to the vector of indices used. More...
 
virtual void nearestKSearch (const PointCloud &cloud, const std::vector< int > &indices, int k, std::vector< std::vector< int > > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point. More...
 
template<typename PointTDiff >
int nearestKSearchT (const PointTDiff &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. More...
 
template<typename PointTDiff >
void nearestKSearchT (const pcl::PointCloud< PointTDiff > &cloud, const std::vector< int > &indices, int k, std::vector< std::vector< int > > &k_indices, std::vector< std::vector< float > > &k_sqr_distances) const
 Search for the k-nearest neighbors for the given query point. More...
 
virtual void radiusSearch (const PointCloud &cloud, const std::vector< int > &indices, double radius, std::vector< std::vector< int > > &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. More...
 
template<typename PointTDiff >
int radiusSearchT (const PointTDiff &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. More...
 
template<typename PointTDiff >
void radiusSearchT (const pcl::PointCloud< PointTDiff > &cloud, const std::vector< int > &indices, double radius, std::vector< std::vector< int > > &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. More...
 

Public Attributes

Ptr tree_
 

Detailed Description

template<typename PointT, typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
class pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >

search::Octree is a wrapper class which implements nearest neighbor search operations based on the pcl::octree::Octree structure.

The octree pointcloud class needs to be initialized with its voxel resolution. Its bounding box is automatically adjusted according to the pointcloud dimension or it can be predefined. Note: The tree depth equates to the resolution and the bounding box dimensions of the octree.

Note
typename: PointT: type of point used in pointcloud
typename: LeafT: leaf node class (usuallt templated with integer indices values)
typename: OctreeT: octree implementation ()
Author
Julius Kammerl

Definition at line 67 of file octree.h.

Member Typedef Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::ConstPtr

Definition at line 80 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesConstPtr

Definition at line 72 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<std::vector<int> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::IndicesPtr

Definition at line 71 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef pcl::PointCloud<PointT> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloud

Definition at line 74 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<const PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudConstPtr

Definition at line 76 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<PointCloud> pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::PointCloudPtr

Definition at line 75 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
typedef boost::shared_ptr<pcl::octree::OctreePointCloudSearch<PointT, LeafTWrap, BranchTWrap> > pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Ptr

Definition at line 79 of file octree.h.

Constructor & Destructor Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::Octree ( const double  resolution)
inline

Octree constructor.

Parameters
[in]resolutionoctree resolution at lowest octree level

Definition at line 90 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
virtual pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::~Octree ( )
inlinevirtual

Empty Destructor.

Definition at line 98 of file octree.h.

Member Function Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( const PointCloudConstPtr cloud,
int  query_index,
int &  result_index,
float &  sqr_distance 
)
inline

Search for approximate nearest neighbor at the query point.

Parameters
[in]cloudthe point cloud data
[in]query_indexthe index in cloud representing the query point
[out]result_indexthe resultant index of the neighbor point
[out]sqr_distancethe resultant squared distance to the neighboring point
Returns
number of neighbors found

Definition at line 248 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( const PointT p_q,
int &  result_index,
float &  sqr_distance 
)
inline

Search for approximate nearest neighbor at the query point.

Parameters
[in]p_qthe given query point
[out]result_indexthe resultant index of the neighbor point
[out]sqr_distancethe resultant squared distance to the neighboring point

Definition at line 260 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::approxNearestSearch ( int  query_index,
int &  result_index,
float &  sqr_distance 
)
inline

Search for approximate nearest neighbor at the query point.

Parameters
query_indexindex 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.
result_indexthe resultant index of the neighbor point
sqr_distancethe resultant squared distance to the neighboring point
Returns
number of neighbors found

Definition at line 273 of file octree.h.

template<typename PointT>
virtual IndicesConstPtr pcl::search::Search< PointT >::getIndices ( ) const
inlinevirtualinherited

Get a pointer to the vector of indices used.

Definition at line 139 of file search.h.

template<typename PointT>
virtual PointCloudConstPtr pcl::search::Search< PointT >::getInputCloud ( ) const
inlinevirtualinherited

Get a pointer to the input point cloud dataset.

Definition at line 132 of file search.h.

template<typename PointT>
virtual const std::string& pcl::search::Search< PointT >::getName ( ) const
inlinevirtualinherited

returns the search method name

Definition at line 104 of file search.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( const PointCloud cloud,
int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const
inlinevirtual

Search for the 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

Reimplemented from pcl::search::Search< PointT >.

Definition at line 138 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( const PointT point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const
inlinevirtual

Search for the 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

Implements pcl::search::Search< PointT >.

Definition at line 153 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::nearestKSearch ( int  index,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const
inlinevirtual

Search for the 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

Reimplemented from pcl::search::Search< PointT >.

Definition at line 171 of file octree.h.

template<typename PointT>
virtual void pcl::search::Search< PointT >::nearestKSearch ( const PointCloud cloud,
const std::vector< int > &  indices,
int  k,
std::vector< std::vector< int > > &  k_indices,
std::vector< std::vector< float > > &  k_sqr_distances 
) const
inlinevirtualinherited

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

Parameters
[in]cloudthe point cloud data
[in]indicesa vector of point cloud indices to query for nearest neighbors
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i
[out]k_sqr_distancesthe resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i

Definition at line 245 of file search.h.

template<typename PointT>
template<typename PointTDiff >
int pcl::search::Search< PointT >::nearestKSearchT ( const PointTDiff &  point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances 
) const
inlineinherited

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

This method accepts a different template parameter for the point type.

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 166 of file search.h.

template<typename PointT>
template<typename PointTDiff >
void pcl::search::Search< PointT >::nearestKSearchT ( const pcl::PointCloud< PointTDiff > &  cloud,
const std::vector< int > &  indices,
int  k,
std::vector< std::vector< int > > &  k_indices,
std::vector< std::vector< float > > &  k_sqr_distances 
) const
inlineinherited

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

Use this method if the query points are of a different type than the points in the data set (e.g. PointXYZRGBA instead of PointXYZ).

Parameters
[in]cloudthe point cloud data
[in]indicesa vector of point cloud indices to query for nearest neighbors
[in]kthe number of neighbors to search for
[out]k_indicesthe resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i
[out]k_sqr_distancesthe resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i
Note
This method copies the input point cloud of type PointTDiff to a temporary cloud of type PointT and performs the batch search on the new cloud. You should prefer the single-point search if you don't use a search algorithm that accelerates batch NN search.

Definition at line 273 of file search.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::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
inlinevirtual

search for all neighbors of query point that are within a given radius.

Parameters
cloudthe point cloud data
indexthe index in cloud representing the query point
radiusthe radius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns
number of neighbors found in radius

Reimplemented from pcl::search::Search< PointT >.

Definition at line 186 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::radiusSearch ( const PointT p_q,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
inlinevirtual

search for all neighbors of query point that are within a given radius.

Parameters
p_qthe given query point
radiusthe radius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns
number of neighbors found in radius

Implements pcl::search::Search< PointT >.

Definition at line 208 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
int pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::radiusSearch ( int  index,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
inlinevirtual

search for all neighbors of query point that are within a given radius.

Parameters
indexindex 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
radiusradius of the sphere bounding all of p_q's neighbors
k_indicesthe resultant indices of the neighboring points
k_sqr_distancesthe resultant squared distances to the neighboring points
max_nnif given, bounds the maximum returned neighbors to this value
Returns
number of neighbors found in radius

Reimplemented from pcl::search::Search< PointT >.

Definition at line 230 of file octree.h.

template<typename PointT>
virtual void pcl::search::Search< PointT >::radiusSearch ( const PointCloud cloud,
const std::vector< int > &  indices,
double  radius,
std::vector< std::vector< int > > &  k_indices,
std::vector< std::vector< float > > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
inlinevirtualinherited

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

Parameters
[in]cloudthe point cloud data
[in]indicesthe indices in cloud. If indices is empty, neighbors will be searched for all points.
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i
[out]k_sqr_distancesthe resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i
[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.

Definition at line 413 of file search.h.

template<typename PointT>
template<typename PointTDiff >
int pcl::search::Search< PointT >::radiusSearchT ( const PointTDiff &  point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
inlineinherited

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_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 329 of file search.h.

template<typename PointT>
template<typename PointTDiff >
void pcl::search::Search< PointT >::radiusSearchT ( const pcl::PointCloud< PointTDiff > &  cloud,
const std::vector< int > &  indices,
double  radius,
std::vector< std::vector< int > > &  k_indices,
std::vector< std::vector< float > > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
inlineinherited

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

Parameters
[in]cloudthe point cloud data
[in]indicesa vector of point cloud indices to query for nearest neighbors
[in]radiusthe radius of the sphere bounding all of p_q's neighbors
[out]k_indicesthe resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i
[out]k_sqr_distancesthe resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i
[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.
Note
This method copies the input point cloud of type PointTDiff to a temporary cloud of type PointT and performs the batch search on the new cloud. You should prefer the single-point search if you don't use a search algorithm that accelerates batch NN search.

Definition at line 449 of file search.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::setInputCloud ( const PointCloudConstPtr cloud)
inline

Provide a pointer to the input dataset.

Parameters
[in]cloudthe const boost shared pointer to a PointCloud message

Definition at line 106 of file octree.h.

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
void pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices 
)
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

Definition at line 119 of file octree.h.

template<typename PointT>
virtual void pcl::search::Search< PointT >::setInputCloud ( const PointCloudConstPtr cloud,
const IndicesConstPtr indices = IndicesConstPtr () 
)
inlinevirtualinherited

Pass the input dataset that the search will be performed on.

Parameters
[in]clouda const pointer to the PointCloud data
[in]indicesthe point indices subset that is to be used from the cloud

Reimplemented in pcl::search::FlannSearch< PointT, FlannDistance >, and pcl::search::KdTree< PointT >.

Definition at line 124 of file search.h.

template<typename PointT>
virtual void pcl::search::Search< PointT >::setSortedResults ( bool  sorted)
inlinevirtualinherited

sets whether the results should be sorted (ascending in the distance) or not

Parameters
[in]sortedshould be true if the results should be sorted by the distance in ascending order. Otherwise the results may be returned in any order.

Reimplemented in pcl::search::KdTree< PointT >.

Definition at line 114 of file search.h.

Member Data Documentation

template<typename PointT , typename LeafTWrap = pcl::octree::OctreeContainerDataTVector<int>, typename BranchTWrap = pcl::octree::OctreeContainerEmpty<int>, typename OctreeT = pcl::octree::OctreeBase<int, LeafTWrap, BranchTWrap >>
Ptr pcl::search::Octree< PointT, LeafTWrap, BranchTWrap, OctreeT >::tree_

Definition at line 81 of file octree.h.


The documentation for this class was generated from the following file: