Renesas / opencv-lib

Dependents:   RZ_A2M_Mbed_samples

Embed: (wiki syntax)

« Back to documentation index

NNIndex< Distance > Class Template Reference

NNIndex< Distance > Class Template Reference

Nearest-neighbour index base class. More...

#include <nn_index.h>

Inherited by AutotunedIndex< Distance >, CompositeIndex< Distance >, HierarchicalClusteringIndex< Distance >, Index< Distance >, KDTreeIndex< Distance >, KDTreeSingleIndex< Distance >, KMeansIndex< Distance >, LinearIndex< Distance >, and LshIndex< Distance >.

Public Member Functions

virtual void buildIndex ()=0
 Builds the index.
virtual void knnSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, int knn, const SearchParams &params)
 Perform k-nearest neighbor search.
virtual int radiusSearch (const Matrix< ElementType > &query, Matrix< int > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams &params)
 Perform radius search.
virtual void saveIndex (FILE *stream)=0
 Saves the index to a stream.
virtual void loadIndex (FILE *stream)=0
 Loads the index from a stream.
virtual size_t size () const =0
virtual size_t veclen () const =0
virtual int usedMemory () const =0
virtual flann_algorithm_t getType () const =0
virtual IndexParams getParameters () const =0
virtual void findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams)=0
 Method that searches for nearest-neighbours.

Detailed Description

template<typename Distance>
class cvflann::NNIndex< Distance >

Nearest-neighbour index base class.

Definition at line 46 of file nn_index.h.


Member Function Documentation

virtual void findNeighbors ( ResultSet< DistanceType > &  result,
const ElementType *  vec,
const SearchParams &  searchParams 
) [pure virtual]

Method that searches for nearest-neighbours.

virtual IndexParams getParameters (  ) const [pure virtual]
virtual flann_algorithm_t getType (  ) const [pure virtual]
virtual void knnSearch ( const Matrix< ElementType > &  queries,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
int  knn,
const SearchParams &  params 
) [virtual]

Perform k-nearest neighbor search.

Parameters:
[in]queriesThe query points for which to find the nearest neighbors
[out]indicesThe indices of the nearest neighbors found
[out]distsDistances to the nearest neighbors found
[in]knnNumber of nearest neighbors to return
[in]paramsSearch parameters

Definition at line 68 of file nn_index.h.

virtual void loadIndex ( FILE *  stream ) [pure virtual]

Loads the index from a stream.

Parameters:
streamThe stream from which the index is loaded

Implemented in CompositeIndex< Distance >, HierarchicalClusteringIndex< Distance >, KDTreeIndex< Distance >, KDTreeSingleIndex< Distance >, KMeansIndex< Distance >, and LshIndex< Distance >.

virtual int radiusSearch ( const Matrix< ElementType > &  query,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
float  radius,
const SearchParams &  params 
) [virtual]

Perform radius search.

Parameters:
[in]queryThe query point
[out]indicesThe indinces of the neighbors found within the given radius
[out]distsThe distances to the nearest neighbors found
[in]radiusThe radius used for search
[in]paramsSearch parameters
Returns:
Number of neighbors found

Definition at line 102 of file nn_index.h.

virtual void saveIndex ( FILE *  stream ) [pure virtual]

Saves the index to a stream.

Parameters:
streamThe stream to save the index to

Implemented in CompositeIndex< Distance >, HierarchicalClusteringIndex< Distance >, KDTreeIndex< Distance >, KDTreeSingleIndex< Distance >, KMeansIndex< Distance >, and LshIndex< Distance >.

virtual size_t size (  ) const [pure virtual]
virtual int usedMemory (  ) const [pure virtual]
virtual size_t veclen (  ) const [pure virtual]