Point Cloud Library (PCL)  1.7.1
List of all members | Classes | Public Member Functions
pcl::search::BruteForce< PointT > Class Template Reference

Implementation of a simple brute force search algorithm. More...

#include <pcl/search/brute_force.h>

+ Inheritance diagram for pcl::search::BruteForce< PointT >:
+ Collaboration diagram for pcl::search::BruteForce< PointT >:

Public Member Functions

 BruteForce (bool sorted_results=false)
 
virtual ~BruteForce ()
 Destructor for KdTree. More...
 
int nearestKSearch (const PointT &point, int k, std::vector< int > &k_indices, std::vector< float > &k_distances) const
 Search for the k-nearest neighbors for the given query point. More...
 
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. More...
 
- Public Member Functions inherited from pcl::search::Search< PointT >
 Search (const std::string &name="", bool sorted=false)
 Constructor. More...
 
virtual ~Search ()
 Destructor. 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 bool getSortedResults ()
 Gets whether the results should be sorted (ascending in the distance) or not Otherwise the results may be returned in any order. 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...
 
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...
 
virtual 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. More...
 
virtual 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). 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 >
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...
 
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...
 
virtual 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. More...
 
virtual 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). 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 >
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...
 

Additional Inherited Members

- Public Types inherited from pcl::search::Search< PointT >
typedef pcl::PointCloud< PointTPointCloud
 
typedef PointCloud::Ptr PointCloudPtr
 
typedef PointCloud::ConstPtr PointCloudConstPtr
 
typedef boost::shared_ptr
< pcl::search::Search< PointT > > 
Ptr
 
typedef boost::shared_ptr
< const pcl::search::Search
< PointT > > 
ConstPtr
 
typedef boost::shared_ptr
< std::vector< int > > 
IndicesPtr
 
typedef boost::shared_ptr
< const std::vector< int > > 
IndicesConstPtr
 
- Protected Member Functions inherited from pcl::search::Search< PointT >
void sortResults (std::vector< int > &indices, std::vector< float > &distances) const
 
- Protected Attributes inherited from pcl::search::Search< PointT >
PointCloudConstPtr input_
 
IndicesConstPtr indices_
 
bool sorted_results_
 
std::string name_
 

Detailed Description

template<typename PointT>
class pcl::search::BruteForce< PointT >

Implementation of a simple brute force search algorithm.

Author
Suat Gedikli

Definition at line 52 of file brute_force.h.

Constructor & Destructor Documentation

template<typename PointT >
pcl::search::BruteForce< PointT >::BruteForce ( bool  sorted_results = false)
inline

Definition at line 88 of file brute_force.h.

template<typename PointT >
virtual pcl::search::BruteForce< PointT >::~BruteForce ( )
inlinevirtual

Destructor for KdTree.

Definition at line 95 of file brute_force.h.

Member Function Documentation

template<typename PointT >
int pcl::search::BruteForce< PointT >::nearestKSearch ( const PointT point,
int  k,
std::vector< int > &  k_indices,
std::vector< float > &  k_distances 
) const
virtual

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_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 54 of file brute_force.hpp.

References pcl::isFinite().

template<typename PointT >
int pcl::search::BruteForce< PointT >::radiusSearch ( const PointT point,
double  radius,
std::vector< int > &  k_indices,
std::vector< float > &  k_sqr_distances,
unsigned int  max_nn = 0 
) const
virtual

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

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

Definition at line 335 of file brute_force.hpp.

References pcl::isFinite().


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