10 #ifndef mrpt_vision_descriptor_kdtrees_H 11 #define mrpt_vision_descriptor_kdtrees_H 48 typedef typename nanoflann::KDTreeSingleIndexAdaptor<metric_t,detail::TSIFTDesc2KDTree_Adaptor<distance_t> >
kdtree_t;
58 ASSERT_(!feats.
empty() && feats[0]->descriptors.hasDescriptorSIFT())
67 nanoflann::KDTreeSingleIndexAdaptorParams
params;
105 typedef typename nanoflann::KDTreeSingleIndexAdaptor<metric_t,detail::TSURFDesc2KDTree_Adaptor<distance_t> >
kdtree_t;
115 ASSERT_(!feats.
empty() && feats[0]->descriptors.hasDescriptorSIFT())
124 nanoflann::KDTreeSingleIndexAdaptorParams
params;
150 template <
typename distance_t,
typename element_t>
151 struct TSIFTDesc2KDTree_Adaptor
160 const size_t dim=
m_feats[idx_p2]->descriptors.SIFT.
size();
161 const element_t *p2 = &
m_feats[idx_p2]->descriptors.SIFT[0];
163 for (
size_t i=0;i<dim;i++)
165 d+=(*p1-*p2)*(*p1-*p2);
172 inline element_t
kdtree_get_pt(
const size_t idx,
int dim)
const {
return m_feats[idx]->descriptors.SIFT[dim]; }
176 template <
typename distance_t,
typename element_t>
177 struct TSURFDesc2KDTree_Adaptor
186 const size_t dim=
m_feats[idx_p2]->descriptors.SURF.
size();
187 const element_t *p2 = &
m_feats[idx_p2]->descriptors.SURF[0];
189 for (
size_t i=0;i<dim;i++)
191 d+=(*p1-*p2)*(*p1-*p2);
198 inline element_t
kdtree_get_pt(
const size_t idx,
int dim)
const {
return m_feats[idx]->descriptors.SURF[dim]; }
A kd-tree builder for sets of features with SURF descriptors.
A kd-tree builder for sets of features with SIFT descriptors.
const CFeatureList & m_feats
TSURFDescriptorsKDTreeIndex(const CFeatureList &feats)
Constructor from a list of SIFT features.
kdtree_t & get_kdtree()
Access to the kd-tree object.
void regenerate_kdtreee()
Re-creates the kd-tree, which must be done whenever the data source (the CFeatureList) changes...
~TSURFDescriptorsKDTreeIndex()
detail::TSIFTDesc2KDTree_Adaptor< distance_t > m_adaptor
const CFeatureList & m_feats
~TSIFTDescriptorsKDTreeIndex()
element_t kdtree_get_pt(const size_t idx, int dim) const
const CFeatureList & m_feats
kdtree_t & get_kdtree()
Access to the kd-tree object.
void regenerate_kdtreee()
Re-creates the kd-tree, which must be done whenever the data source (the CFeatureList) changes...
size_t kdtree_get_point_count() const
nanoflann::KDTreeSingleIndexAdaptor< metric_t, detail::TSIFTDesc2KDTree_Adaptor< distance_t > > kdtree_t
distance_t kdtree_distance(const element_t *p1, const size_t idx_p2, size_t size) const
const CFeatureList & m_feats
A list of visual features, to be used as output by detectors, as input/output by trackers, etc.
const kdtree_t & get_kdtree() const
detail::TSURFDesc2KDTree_Adaptor< distance_t > m_adaptor
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
distance_t kdtree_distance(const element_t *p1, const size_t idx_p2, size_t size) const
nanoflann::KDTreeSingleIndexAdaptor< metric_t, detail::TSURFDesc2KDTree_Adaptor< distance_t > > kdtree_t
TSIFTDescriptorsKDTreeIndex(const CFeatureList &feats)
Constructor from a list of SIFT features.
element_t kdtree_get_pt(const size_t idx, int dim) const
bool kdtree_get_bbox(BBOX &bb) const
const kdtree_t & get_kdtree() const
GLenum const GLfloat * params
TSURFDesc2KDTree_Adaptor(const CFeatureList &feats)
TSIFTDesc2KDTree_Adaptor(const CFeatureList &feats)
bool kdtree_get_bbox(BBOX &bb) const
size_t kdtree_get_point_count() const