Main MRPT website > C++ reference for MRPT 1.9.9
Classes | Functions
kdtree.h File Reference
#include <mrpt/otherlibs/do_opencv_includes.h>
Include dependency graph for kdtree.h:

Go to the source code of this file.

Classes

struct  kd_node
 a node in a k-d tree More...
 

Functions

struct kd_nodekdtree_build (struct feature *features, int n)
 A function to build a k-d tree database from keypoints in an array. More...
 
int kdtree_bbf_knn (struct kd_node *kd_root, struct feature *feat, int k, struct feature ***nbrs, int max_nn_chks)
 Finds an image feature's approximate k nearest neighbors in a kd tree using Best Bin First search. More...
 
int kdtree_bbf_spatial_knn (struct kd_node *kd_root, struct feature *feat, int k, struct feature ***nbrs, int max_nn_chks, CvRect rect, int model)
 Finds an image feature's approximate k nearest neighbors within a specified spatial region in a kd tree using Best Bin First search. More...
 
void kdtree_release (struct kd_node *kd_root)
 De-allocates memory held by a kd tree. More...
 

Function Documentation

◆ kdtree_bbf_knn()

int kdtree_bbf_knn ( struct kd_node kd_root,
struct feature feat,
int  k,
struct feature ***  nbrs,
int  max_nn_chks 
)

Finds an image feature's approximate k nearest neighbors in a kd tree using Best Bin First search.

Parameters
kd_rootroot of an image feature kd tree
featimage feature for whose neighbors to search
knumber of neighbors to find
nbrspointer to an array in which to store pointers to neighbors in order of increasing descriptor distance
max_nn_chkssearch is cut off after examining this many tree entries
Returns
Returns the number of neighbors found and stored in nbrs, or -1 on error.

◆ kdtree_bbf_spatial_knn()

int kdtree_bbf_spatial_knn ( struct kd_node kd_root,
struct feature feat,
int  k,
struct feature ***  nbrs,
int  max_nn_chks,
CvRect  rect,
int  model 
)

Finds an image feature's approximate k nearest neighbors within a specified spatial region in a kd tree using Best Bin First search.

Parameters
kd_rootroot of an image feature kd tree
featimage feature for whose neighbors to search
knumber of neighbors to find
nbrspointer to an array in which to store pointers to neighbors in order of increasing descriptor distance
max_nn_chkssearch is cut off after examining this many tree entries
rectrectangular region in which to search for neighbors
modelif true, spatial search is based on kdtree features' model locations; otherwise it is based on their image locations
Returns
Returns the number of neighbors found and stored in nbrs (in case k neighbors could not be found before examining max_nn_checks keypoint entries).

◆ kdtree_build()

struct kd_node* kdtree_build ( struct feature features,
int  n 
)

A function to build a k-d tree database from keypoints in an array.

Parameters
featuresan array of features
nthe number of features in features
Returns
Returns the root of a kd tree built from features.

◆ kdtree_release()

void kdtree_release ( struct kd_node kd_root)

De-allocates memory held by a kd tree.

Parameters
kd_rootpointer to the root of a kd tree



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST