OpenCV  3.4.3
Open Source Computer Vision
Public Member Functions | List of all members
cvflann::NNIndex< Distance > Class Template Referenceabstract

#include "nn_index.h"

Inheritance diagram for cvflann::NNIndex< Distance >:
cvflann::AutotunedIndex< Distance > cvflann::CompositeIndex< Distance > cvflann::HierarchicalClusteringIndex< Distance > cvflann::Index< Distance > cvflann::KDTreeIndex< Distance > cvflann::KDTreeSingleIndex< Distance > cvflann::KMeansIndex< Distance > cvflann::LinearIndex< Distance > cvflann::LshIndex< Distance >

Public Member Functions

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

Detailed Description

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

Nearest-neighbour index base class

Constructor & Destructor Documentation

§ ~NNIndex()

template<typename Distance>
virtual cvflann::NNIndex< Distance >::~NNIndex ( )
inlinevirtual

Member Function Documentation

§ buildIndex()

template<typename Distance>
virtual void cvflann::NNIndex< Distance >::buildIndex ( )
pure virtual

§ findNeighbors()

template<typename Distance>
virtual void cvflann::NNIndex< Distance >::findNeighbors ( ResultSet< DistanceType > &  result,
const ElementType *  vec,
const SearchParams searchParams 
)
pure virtual

§ getParameters()

template<typename Distance>
virtual IndexParams cvflann::NNIndex< Distance >::getParameters ( ) const
pure virtual

§ getType()

template<typename Distance>
virtual flann_algorithm_t cvflann::NNIndex< Distance >::getType ( ) const
pure virtual

§ knnSearch()

template<typename Distance>
virtual void cvflann::NNIndex< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
int  knn,
const SearchParams params 
)
inlinevirtual

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

Reimplemented in cvflann::Index< Distance >, cvflann::Index< cv::L2< ElementType > >, cvflann::Index< cv::L1< ElementType > >, cvflann::KDTreeSingleIndex< Distance >, and cvflann::LshIndex< Distance >.

§ loadIndex()

template<typename Distance>
virtual void cvflann::NNIndex< Distance >::loadIndex ( FILE *  stream)
pure virtual

§ radiusSearch()

template<typename Distance>
virtual int cvflann::NNIndex< Distance >::radiusSearch ( const Matrix< ElementType > &  query,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
float  radius,
const SearchParams params 
)
inlinevirtual

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

Reimplemented in cvflann::Index< Distance >, cvflann::Index< cv::L2< ElementType > >, and cvflann::Index< cv::L1< ElementType > >.

§ saveIndex()

template<typename Distance>
virtual void cvflann::NNIndex< Distance >::saveIndex ( FILE *  stream)
pure virtual

§ size()

template<typename Distance>
virtual size_t cvflann::NNIndex< Distance >::size ( ) const
pure virtual

§ usedMemory()

template<typename Distance>
virtual int cvflann::NNIndex< Distance >::usedMemory ( ) const
pure virtual

§ veclen()

template<typename Distance>
virtual size_t cvflann::NNIndex< Distance >::veclen ( ) const
pure virtual

The documentation for this class was generated from the following file: