Point Cloud Library (PCL)
1.7.0
|
search::FlannSearch is a generic FLANN wrapper class for the new search interface. More...
#include <pcl/search/flann_search.h>
Classes | |
class | FlannIndexCreator |
Helper class that creates a FLANN index from a given FLANN matrix. More... | |
class | KdTreeIndexCreator |
Creates a FLANN KdTreeSingleIndex from the given input data. More... | |
class | KMeansIndexCreator |
Creates a FLANN KdTreeSingleIndex from the given input data. More... | |
Public Types | |
typedef boost::shared_ptr < FlannSearch< PointT, FlannDistance > > | Ptr |
typedef boost::shared_ptr < const FlannSearch< PointT, FlannDistance > > | ConstPtr |
typedef boost::shared_ptr < FlannIndexCreator > | FlannIndexCreatorPtr |
![]() | |
typedef pcl::PointCloud< PointT > | PointCloud |
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 |
Public Member Functions | |
FlannSearch (bool sorted=true, FlannIndexCreatorPtr creator=FlannIndexCreatorPtr(new KdTreeIndexCreator())) | |
virtual | ~FlannSearch () |
Destructor for FlannSearch. More... | |
void | setEpsilon (double eps) |
Set the search epsilon precision (error bound) for nearest neighbors searches. More... | |
double | getEpsilon () |
Get the search epsilon precision (error bound) for nearest neighbors searches. More... | |
virtual void | setInputCloud (const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) |
Provide a pointer to the input dataset. 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... | |
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... | |
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... | |
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 the k-nearest neighbors for the given query point. More... | |
void | setPointRepresentation (const PointRepresentationConstPtr &point_representation) |
Provide a pointer to the point representation to use to convert points into k-D vectors. More... | |
PointRepresentationConstPtr const | getPointRepresentation () |
Get a pointer to the point representation used when converting points into k-D vectors. More... | |
![]() | |
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 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... | |
Protected Member Functions | |
void | convertInputToFlannMatrix () |
converts the input data to a format usable by FLANN More... | |
![]() | |
void | sortResults (std::vector< int > &indices, std::vector< float > &distances) const |
Protected Attributes | |
IndexPtr | index_ |
The FLANN index. More... | |
FlannIndexCreatorPtr | creator_ |
The index creator, used to (re-) create the index when the search data is passed. More... | |
MatrixPtr | input_flann_ |
Input data in FLANN format. More... | |
float | eps_ |
Epsilon for approximate NN search. More... | |
bool | input_copied_for_flann_ |
PointRepresentationConstPtr | point_representation_ |
int | dim_ |
std::vector< int > | index_mapping_ |
bool | identity_mapping_ |
![]() | |
PointCloudConstPtr | input_ |
IndicesConstPtr | indices_ |
bool | sorted_results_ |
std::string | name_ |
search::FlannSearch is a generic FLANN wrapper class for the new search interface.
It is able to wrap any FLANN index type, e.g. the kd tree as well as indices for high-dimensional searches and intended as a more powerful and cleaner successor to KdTreeFlann.
Definition at line 67 of file flann_search.h.
typedef boost::shared_ptr<const FlannSearch<PointT, FlannDistance> > pcl::search::FlannSearch< PointT, FlannDistance >::ConstPtr |
Definition at line 89 of file flann_search.h.
typedef boost::shared_ptr<FlannIndexCreator> pcl::search::FlannSearch< PointT, FlannDistance >::FlannIndexCreatorPtr |
Definition at line 109 of file flann_search.h.
typedef boost::shared_ptr<FlannSearch<PointT, FlannDistance> > pcl::search::FlannSearch< PointT, FlannDistance >::Ptr |
Definition at line 88 of file flann_search.h.
pcl::search::FlannSearch< PointT, FlannDistance >::FlannSearch | ( | bool | sorted = true , |
FlannIndexCreatorPtr | creator = FlannIndexCreatorPtr (new KdTreeIndexCreator ()) |
||
) |
Definition at line 64 of file flann_search.hpp.
References pcl::search::FlannSearch< PointT, FlannDistance >::dim_, and pcl::search::FlannSearch< PointT, FlannDistance >::point_representation_.
|
virtual |
Destructor for FlannSearch.
Definition at line 73 of file flann_search.hpp.
|
protected |
converts the input data to a format usable by FLANN
Definition at line 348 of file flann_search.hpp.
|
inline |
Get the search epsilon precision (error bound) for nearest neighbors searches.
Definition at line 177 of file flann_search.h.
References pcl::search::FlannSearch< PointT, FlannDistance >::eps_.
|
inline |
Get a pointer to the point representation used when converting points into k-D vectors.
Definition at line 253 of file flann_search.h.
References pcl::search::FlannSearch< PointT, FlannDistance >::point_representation_.
|
virtual |
Search for the 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_sqr_distances | the resultant squared distances to the neighboring points (must be resized to k a priori!) |
Implements pcl::search::Search< PointT >.
Definition at line 92 of file flann_search.hpp.
|
virtual |
Search for the k-nearest neighbors for the given query point.
[in] | cloud | the point cloud data |
[in] | indices | a vector of point cloud indices to query for nearest neighbors |
[in] | k | the number of neighbors to search for |
[out] | k_indices | the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i |
[out] | k_sqr_distances | the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i |
Definition at line 133 of file flann_search.hpp.
References pcl::PointCloud< T >::is_dense, and pcl::PointCloud< T >::size().
|
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_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. |
Implements pcl::search::Search< PointT >.
Definition at line 219 of file flann_search.hpp.
|
virtual |
Search for the k-nearest neighbors for the given query point.
[in] | cloud | the point cloud data |
[in] | indices | a vector of point cloud indices to query for nearest neighbors |
[in] | radius | the radius of the sphere bounding all of p_q's neighbors |
[out] | k_indices | the resultant indices of the neighboring points, k_indices[i] corresponds to the neighbors of the query point i |
[out] | k_sqr_distances | the resultant squared distances to the neighboring points, k_sqr_distances[i] corresponds to the neighbors of the query point i |
[in] | max_nn | if given, bounds the maximum returned neighbors to this value |
Definition at line 261 of file flann_search.hpp.
References pcl::PointCloud< T >::is_dense, and pcl::PointCloud< T >::size().
|
inline |
Set the search epsilon precision (error bound) for nearest neighbors searches.
[in] | eps | precision (error bound) for nearest neighbors searches |
Definition at line 170 of file flann_search.h.
References pcl::search::FlannSearch< PointT, FlannDistance >::eps_.
|
virtual |
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 |
Reimplemented from pcl::search::Search< PointT >.
Definition at line 81 of file flann_search.hpp.
Referenced by pcl::search::FlannSearch< PointT, FlannDistance >::setPointRepresentation().
|
inline |
Provide a pointer to the point representation to use to convert points into k-D vectors.
[in] | point_representation | the const boost shared pointer to a PointRepresentation |
Definition at line 243 of file flann_search.h.
References pcl::search::FlannSearch< PointT, FlannDistance >::dim_, pcl::search::Search< PointT >::indices_, pcl::search::Search< PointT >::input_, pcl::search::FlannSearch< PointT, FlannDistance >::point_representation_, and pcl::search::FlannSearch< PointT, FlannDistance >::setInputCloud().
|
protected |
The index creator, used to (re-) create the index when the search data is passed.
Definition at line 270 of file flann_search.h.
|
protected |
Definition at line 283 of file flann_search.h.
Referenced by pcl::search::FlannSearch< PointT, FlannDistance >::FlannSearch(), and pcl::search::FlannSearch< PointT, FlannDistance >::setPointRepresentation().
|
protected |
Epsilon for approximate NN search.
Definition at line 278 of file flann_search.h.
Referenced by pcl::search::FlannSearch< PointT, FlannDistance >::getEpsilon(), and pcl::search::FlannSearch< PointT, FlannDistance >::setEpsilon().
|
protected |
Definition at line 286 of file flann_search.h.
|
protected |
The FLANN index.
Definition at line 266 of file flann_search.h.
|
protected |
Definition at line 285 of file flann_search.h.
|
protected |
Definition at line 279 of file flann_search.h.
|
protected |
Input data in FLANN format.
Definition at line 274 of file flann_search.h.
|
protected |