39 #ifndef PCL_SEARCH_FLANN_SEARCH_H_
40 #define PCL_SEARCH_FLANN_SEARCH_H_
49 template<
typename T>
class L2;
66 template<
typename Po
intT,
typename FlannDistance=flann::L2_Simple <
float> >
72 typedef boost::shared_ptr<std::vector<int> > IndicesPtr;
73 typedef boost::shared_ptr<const std::vector<int> > IndicesConstPtr;
75 typedef boost::shared_ptr<flann::NNIndex <FlannDistance > > IndexPtr;
76 typedef boost::shared_ptr<flann::Matrix <float> > MatrixPtr;
77 typedef boost::shared_ptr<const flann::Matrix <float> > MatrixConstPtr;
81 typedef boost::shared_ptr<const PointRepresentation> PointRepresentationConstPtr;
88 typedef boost::shared_ptr<FlannSearch<PointT> >
Ptr;
89 typedef boost::shared_ptr<const FlannSearch<PointT> >
ConstPtr;
103 virtual IndexPtr
createIndex (MatrixConstPtr data)=0;
120 virtual IndexPtr
createIndex (MatrixConstPtr data);
122 unsigned int max_leaf_size_;
125 FlannSearch (
bool sorted =
true, FlannIndexCreator* creator =
new KdTreeIndexCreator());
167 nearestKSearch (
const PointT &point,
int k, std::vector<int> &k_indices, std::vector<float> &k_sqr_distances)
const;
179 std::vector< std::vector<int> >& k_indices, std::vector< std::vector<float> >& k_sqr_distances)
const;
193 std::vector<int> &k_indices, std::vector<float> &k_sqr_distances,
194 unsigned int max_nn = 0)
const;
205 radiusSearch (
const PointCloud& cloud,
const std::vector<int>& indices,
double radius, std::vector< std::vector<int> >& k_indices,
206 std::vector< std::vector<float> >& k_sqr_distances,
unsigned int max_nn=0)
const;
214 point_representation_ = point_representation;
219 inline PointRepresentationConstPtr
const
222 return (point_representation_);
229 void convertInputToFlannMatrix();
237 FlannIndexCreator *creator_;
241 MatrixPtr input_flann_;
246 bool input_copied_for_flann_;
248 PointRepresentationConstPtr point_representation_;
252 std::vector<int> index_mapping_;
253 bool identity_mapping_;
259 #define PCL_INSTANTIATE_FlannSearch(T) template class PCL_EXPORTS pcl::search::FlannSearch<T>;
261 #endif // PCL_SEARCH_KDTREE_H_