Point Cloud Library (PCL)
1.9.1
|
39 #ifndef PCL_SEARCH_FLANN_SEARCH_H_
40 #define PCL_SEARCH_FLANN_SEARCH_H_
42 #include <pcl/search/search.h>
44 #include <pcl/point_representation.h>
49 template<
typename T>
struct L2;
100 template<
typename Po
intT,
typename FlannDistance=flann::L2_Simple <
float> >
108 typedef boost::shared_ptr<FlannSearch<PointT, FlannDistance> >
Ptr;
109 typedef boost::shared_ptr<const FlannSearch<PointT, FlannDistance> >
ConstPtr;
117 typedef boost::shared_ptr<flann::Matrix <float> >
MatrixPtr;
121 typedef boost::shared_ptr<flann::NNIndex <FlannDistance > >
IndexPtr;
167 unsigned int max_leaf_size_;
273 nearestKSearch (
const PointT &point,
int k, std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const;
285 std::vector< std::vector<int> >& k_indices, std::vector< std::vector<float> >& k_sqr_distances)
const;
299 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances,
300 unsigned int max_nn = 0)
const;
311 radiusSearch (
const PointCloud& cloud,
const std::vector<int>& indices,
double radius, std::vector< std::vector<int> >& k_indices,
312 std::vector< std::vector<float> >& k_sqr_distances,
unsigned int max_nn=0)
const;
321 dim_ = point_representation->getNumberOfDimensions ();
372 #define PCL_INSTANTIATE_FlannSearch(T) template class PCL_EXPORTS pcl::search::FlannSearch<T>;
374 #endif // PCL_SEARCH_KDTREE_H_
This file defines compatibility wrappers for low level I/O functions.
FlannSearch(bool sorted=true, FlannIndexCreatorPtr creator=FlannIndexCreatorPtr(new KdTreeIndexCreator()))
KdTreeIndexCreator(unsigned int max_leaf_size=15)
boost::shared_ptr< flann::NNIndex< FlannDistance > > IndexPtr
virtual ~KdTreeIndexCreator()
Empty destructor.
int checks_
Number of checks to perform for approximate NN search using the multiple randomized tree index.
boost::shared_ptr< FlannSearch< PointT, FlannDistance > > Ptr
Search< PointT >::PointCloudConstPtr PointCloudConstPtr
void setChecks(int checks)
Set the number of checks to perform during approximate searches in multiple randomized trees.
virtual IndexPtr createIndex(MatrixConstPtr data)
Create a FLANN Index from the input data.
boost::shared_ptr< const FlannSearch< PointT, FlannDistance > > ConstPtr
Creates a FLANN KdTreeSingleIndex from the given input data.
PointCloud represents the base class in PCL for storing collections of 3D points.
int getChecks()
Get the number of checks to perform during approximate searches in multiple randomized trees.
boost::shared_ptr< std::vector< int > > IndicesPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
void convertInputToFlannMatrix()
converts the input data to a format usable by FLANN
virtual IndexPtr createIndex(MatrixConstPtr data)=0
Create a FLANN Index from the input data.
Search< PointT >::PointCloud PointCloud
Creates a FLANN KdTreeIndex of multiple randomized trees from the given input data,...
PointCloudConstPtr input_
PointRepresentationConstPtr point_representation_
MatrixPtr input_flann_
Input data in FLANN format.
PointRepresentation provides a set of methods for converting a point structs/object into an n-dimensi...
double getEpsilon()
Get the search epsilon precision (error bound) for nearest neighbors searches.
PointCloud::ConstPtr PointCloudConstPtr
bool input_copied_for_flann_
Helper class that creates a FLANN index from a given FLANN matrix.
IndexPtr index_
The FLANN index.
boost::shared_ptr< const PointRepresentation > PointRepresentationConstPtr
Creates a FLANN KdTreeSingleIndex from the given input data.
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
virtual ~KMeansIndexCreator()
Empty destructor.
void setEpsilon(double eps)
Set the search epsilon precision (error bound) for nearest neighbors searches.
KdTreeMultiIndexCreator(int trees=4)
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.
float eps_
Epsilon for approximate NN search.
virtual ~FlannIndexCreator()
destructor
flann::NNIndex< FlannDistance > Index
virtual void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr())
Provide a pointer to the input dataset.
search::FlannSearch is a generic FLANN wrapper class for the new search interface.
virtual IndexPtr createIndex(MatrixConstPtr data)
Create a FLANN Index from the input data.
boost::shared_ptr< const flann::Matrix< float > > MatrixConstPtr
virtual IndexPtr createIndex(MatrixConstPtr data)
Create a FLANN Index from the input data.
FlannIndexCreatorPtr creator_
The index creator, used to (re-) create the index when the search data is passed.
virtual ~KdTreeMultiIndexCreator()
Empty destructor.
boost::shared_ptr< flann::Matrix< float > > MatrixPtr
void setPointRepresentation(const PointRepresentationConstPtr &point_representation)
Provide a pointer to the point representation to use to convert points into k-D vectors.
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.
boost::shared_ptr< const std::vector< int > > IndicesConstPtr
boost::shared_ptr< FlannIndexCreator > FlannIndexCreatorPtr
const PointRepresentationConstPtr getPointRepresentation()
Get a pointer to the point representation used when converting points into k-D vectors.
boost::shared_ptr< PointRepresentation > PointRepresentationPtr
pcl::PointRepresentation< PointT > PointRepresentation
std::vector< int > index_mapping_
KMeansIndexCreator()
All FLANN kd trees created by this class will have a maximum of max_leaf_size points per leaf node.
virtual ~FlannSearch()
Destructor for FlannSearch.