opencv on mbed

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

UniqueResultSet< DistanceType > Class Template Reference

UniqueResultSet< DistanceType > Class Template Reference

Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays. More...

#include <result_set.h>

Inherits cvflann::ResultSet< DistanceType >.

Inherited by KNNUniqueResultSet< DistanceType >, and RadiusUniqueResultSet< DistanceType >.

Public Member Functions

 UniqueResultSet ()
 Default cosntructor.
bool full () const
 Check the status of the set.
virtual void clear ()=0
 Remove all elements in the set.
virtual void copy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 Copy the set to two C arrays.
virtual void sortAndCopy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 Copy the set to two C arrays but sort it according to the distance first.
size_t size () const
 The number of neighbors in the set.
DistanceType worstDist () const
 The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value.

Protected Attributes

bool is_full_
 Flag to say if the set is full.
DistanceType worst_distance_
 The worst distance found so far.
std::set< DistIndex > dist_indices_
 The best candidates so far.

Detailed Description

template<typename DistanceType>
class cvflann::UniqueResultSet< DistanceType >

Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays.

Definition at line 287 of file result_set.h.


Constructor & Destructor Documentation

Default cosntructor.

Definition at line 305 of file result_set.h.


Member Function Documentation

virtual void clear (  ) [pure virtual]
virtual void copy ( int *  indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const [virtual]

Copy the set to two C arrays.

Parameters:
indicespointer to a C array of indices
distpointer to a C array of distances
n_neighborsthe number of neighbors to copy

Definition at line 327 of file result_set.h.

bool full (  ) const

Check the status of the set.

Returns:
true if we have k NN

Reimplemented in RadiusUniqueResultSet< DistanceType >.

Definition at line 313 of file result_set.h.

size_t size (  ) const

The number of neighbors in the set.

Returns:

Definition at line 359 of file result_set.h.

virtual void sortAndCopy ( int *  indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const [virtual]

Copy the set to two C arrays but sort it according to the distance first.

Parameters:
indicespointer to a C array of indices
distpointer to a C array of distances
n_neighborsthe number of neighbors to copy

Definition at line 351 of file result_set.h.

DistanceType worstDist (  ) const

The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value.

Returns:

Reimplemented in RadiusUniqueResultSet< DistanceType >.

Definition at line 368 of file result_set.h.


Field Documentation

std::set<DistIndex> dist_indices_ [protected]

The best candidates so far.

Definition at line 380 of file result_set.h.

bool is_full_ [protected]

Flag to say if the set is full.

Definition at line 374 of file result_set.h.

DistanceType worst_distance_ [protected]

The worst distance found so far.

Definition at line 377 of file result_set.h.