opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

HierarchicalClusteringIndex< Distance > Class Template Reference

HierarchicalClusteringIndex< Distance > Class Template Reference

Hierarchical index. More...

#include <hierarchical_clustering_index.h>

Inherits cvflann::NNIndex< Distance >.

Public Member Functions

 HierarchicalClusteringIndex (const Matrix< ElementType > &inputData, const IndexParams &index_params=HierarchicalClusteringIndexParams(), Distance d=Distance())
 Index constructor.
virtual ~HierarchicalClusteringIndex ()
 Index destructor.
void free_elements ()
 Release the inner elements of indices[].
size_t size () const
 Returns size of index.
size_t veclen () const
 Returns the length of an index feature.
int usedMemory () const
 Computes the inde memory usage Returns: memory used by the index.
void buildIndex ()
 Builds the index.
flann_algorithm_t getType () const
void saveIndex (FILE *stream)
 Saves the index to a stream.
void loadIndex (FILE *stream)
 Loads the index from a stream.
void findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams)
 Find set of nearest neighbors to vec.
IndexParams getParameters () const
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 findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams)=0
 Method that searches for nearest-neighbours.

Detailed Description

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

Hierarchical index.

Contains a tree constructed through a hierarchical clustering and other information for indexing a set of points for nearest-neighbour matching.

Definition at line 80 of file hierarchical_clustering_index.h.


Constructor & Destructor Documentation

HierarchicalClusteringIndex ( const Matrix< ElementType > &  inputData,
const IndexParams &  index_params = HierarchicalClusteringIndexParams(),
Distance  d = Distance() 
)

Index constructor.

Params: inputData = dataset with the input features params = parameters passed to the hierarchical k-means algorithm

Definition at line 357 of file hierarchical_clustering_index.h.

virtual ~HierarchicalClusteringIndex (  ) [virtual]

Index destructor.

Release the memory used by the index.

Definition at line 405 of file hierarchical_clustering_index.h.


Member Function Documentation

void buildIndex (  ) [virtual]

Builds the index.

Implements NNIndex< Distance >.

Definition at line 464 of file hierarchical_clustering_index.h.

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

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 searchParams = parameters that influence the search algorithm (checks)

Definition at line 547 of file hierarchical_clustering_index.h.

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

Method that searches for nearest-neighbours.

void free_elements (  )

Release the inner elements of indices[].

Definition at line 422 of file hierarchical_clustering_index.h.

IndexParams getParameters (  ) const [virtual]
Returns:
The index parameters

Implements NNIndex< Distance >.

Definition at line 572 of file hierarchical_clustering_index.h.

flann_algorithm_t getType (  ) const [virtual]
Returns:
The index type (kdtree, kmeans,...)

Implements NNIndex< Distance >.

Definition at line 483 of file hierarchical_clustering_index.h.

virtual void knnSearch ( const Matrix< ElementType > &  queries,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
int  knn,
const SearchParams &  params 
) [virtual, inherited]

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.

void loadIndex ( FILE *  stream ) [virtual]

Loads the index from a stream.

Parameters:
streamThe stream from which the index is loaded

Implements NNIndex< Distance >.

Definition at line 504 of file hierarchical_clustering_index.h.

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

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.

void saveIndex ( FILE *  stream ) [virtual]

Saves the index to a stream.

Parameters:
streamThe stream to save the index to

Implements NNIndex< Distance >.

Definition at line 489 of file hierarchical_clustering_index.h.

size_t size (  ) const [virtual]

Returns size of index.

Implements NNIndex< Distance >.

Definition at line 438 of file hierarchical_clustering_index.h.

int usedMemory (  ) const [virtual]

Computes the inde memory usage Returns: memory used by the index.

Implements NNIndex< Distance >.

Definition at line 456 of file hierarchical_clustering_index.h.

size_t veclen (  ) const [virtual]

Returns the length of an index feature.

Implements NNIndex< Distance >.

Definition at line 446 of file hierarchical_clustering_index.h.