OpenCV  4.1.0
Open Source Computer Vision
Public Member Functions | Protected Types | Protected Attributes | List of all members
cvflann::KNNUniqueResultSet< DistanceType > Class Template Reference

#include <opencv2/flann/result_set.h>

Inheritance diagram for cvflann::KNNUniqueResultSet< DistanceType >:
cvflann::UniqueResultSet< DistanceType > cvflann::ResultSet< DistanceType > cvflann::KNNRadiusUniqueResultSet< DistanceType >

Public Member Functions

 KNNUniqueResultSet (unsigned int capacity)
 
void addPoint (DistanceType dist, int index) CV_OVERRIDE
 
void clear () CV_OVERRIDE
 
- Public Member Functions inherited from cvflann::UniqueResultSet< DistanceType >
 UniqueResultSet ()
 
virtual void copy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 
bool full () const CV_OVERRIDE
 
size_t size () const
 
virtual void sortAndCopy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 
DistanceType worstDist () const CV_OVERRIDE
 
- Public Member Functions inherited from cvflann::ResultSet< DistanceType >
virtual ~ResultSet ()
 

Protected Types

typedef UniqueResultSet
< DistanceType >::DistIndex 
DistIndex
 

Protected Attributes

unsigned int capacity_
 
- Protected Attributes inherited from cvflann::UniqueResultSet< DistanceType >
std::set< DistIndexdist_indices_
 
bool is_full_
 
DistanceType worst_distance_
 

Detailed Description

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

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

Member Typedef Documentation

template<typename DistanceType>
typedef UniqueResultSet<DistanceType>::DistIndex cvflann::KNNUniqueResultSet< DistanceType >::DistIndex
protected

Constructor & Destructor Documentation

template<typename DistanceType>
cvflann::KNNUniqueResultSet< DistanceType >::KNNUniqueResultSet ( unsigned int  capacity)
inline

Constructor

Parameters
capacitythe number of neighbors to store at max

Member Function Documentation

template<typename DistanceType>
void cvflann::KNNUniqueResultSet< DistanceType >::addPoint ( DistanceType  dist,
int  index 
)
inlinevirtual

Add a possible candidate to the best neighbors

Parameters
distdistance for that neighbor
indexindex of that neighbor

Implements cvflann::ResultSet< DistanceType >.

template<typename DistanceType>
void cvflann::KNNUniqueResultSet< DistanceType >::clear ( )
inlinevirtual

Remove all elements in the set

Implements cvflann::UniqueResultSet< DistanceType >.

Reimplemented in cvflann::KNNRadiusUniqueResultSet< DistanceType >.

Member Data Documentation

template<typename DistanceType>
unsigned int cvflann::KNNUniqueResultSet< DistanceType >::capacity_
protected

The number of neighbors to keep


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