#include <kdtree_index.h>
Inherits cvflann::NNIndex< ELEM_TYPE >.
Classes | |
struct | TreeSt |
Public Member Functions | |
flann_algorithm_t | getType () const |
KDTreeIndex (const Matrix< ELEM_TYPE > &inputData, const KDTreeIndexParams ¶ms=KDTreeIndexParams()) | |
~KDTreeIndex () | |
void | buildIndex () |
void | saveIndex (FILE *stream) |
void | loadIndex (FILE *stream) |
size_t | size () const |
size_t | veclen () const |
int | usedMemory () const |
void | findNeighbors (ResultSet< ELEM_TYPE > &result, const ELEM_TYPE *vec, const SearchParams &searchParams) |
const IndexParams * | getParameters () const |
Randomized kd-tree index
Contains the k-d trees and other information for indexing a set of points for nearest-neighbor matching.
cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::KDTreeIndex | ( | const Matrix< ELEM_TYPE > & | inputData, |
const KDTreeIndexParams & | params = KDTreeIndexParams() |
||
) |
KDTree constructor
Params: inputData = dataset with the input features params = parameters passed to the kdtree algorithm
cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::~KDTreeIndex | ( | ) |
Standard destructor
flann_algorithm_t cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::getType | ( | ) | const [virtual] |
Algorithm name
Implements cvflann::NNIndex< ELEM_TYPE >.
void cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::buildIndex | ( | ) | [virtual] |
Builds the index
Implements cvflann::NNIndex< ELEM_TYPE >.
void cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::saveIndex | ( | FILE * | stream | ) | [virtual] |
Saves the index to a stream
Implements cvflann::NNIndex< ELEM_TYPE >.
void cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::loadIndex | ( | FILE * | stream | ) | [virtual] |
Loads the index from a stream
Implements cvflann::NNIndex< ELEM_TYPE >.
size_t cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::size | ( | ) | const [virtual] |
Returns size of index.
Implements cvflann::NNIndex< ELEM_TYPE >.
size_t cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::veclen | ( | ) | const [virtual] |
Returns the length of an index feature.
Implements cvflann::NNIndex< ELEM_TYPE >.
int cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::usedMemory | ( | ) | const [virtual] |
Computes the inde memory usage Returns: memory used by the index
Implements cvflann::NNIndex< ELEM_TYPE >.
void cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::findNeighbors | ( | ResultSet< ELEM_TYPE > & | result, |
const ELEM_TYPE * | vec, | ||
const SearchParams & | searchParams | ||
) | [virtual] |
Find set of nearest neighbors to vec. Their indices are stored inside the result object.
Params: result = the result object in which the indices of the nearest-neighbors are stored vec = the vector for which to search the nearest neighbors maxCheck = the maximum number of restarts (in a best-bin-first manner)
Implements cvflann::NNIndex< ELEM_TYPE >.
const IndexParams* cvflann::KDTreeIndex< ELEM_TYPE, DIST_TYPE >::getParameters | ( | ) | const [virtual] |
Returns the parameters used for the index
Implements cvflann::NNIndex< ELEM_TYPE >.