OpenCV  3.2.0-dev
Open Source Computer Vision
cvflann::RadiusUniqueResultSet< DistanceType > Class Template Reference

Class that holds the radius nearest neighbors It is more accurate than RadiusResult as it is not limited in the number of neighbors. More...

#include "result_set.h"

Inheritance diagram for cvflann::RadiusUniqueResultSet< DistanceType >:
Collaboration diagram for cvflann::RadiusUniqueResultSet< DistanceType >:

Public Member Functions

 RadiusUniqueResultSet (DistanceType radius)
 Constructor. More...
 
void addPoint (DistanceType dist, int index)
 Add a possible candidate to the best neighbors. More...
 
void clear ()
 Remove all elements in the set. More...
 
virtual void copy (int *indices, DistanceType *dist, int n_neighbors=-1) const
 Copy the set to two C arrays. More...
 
bool full () const
 Check the status of the set. More...
 
size_t size () const
 The number of neighbors in the set. More...
 
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. More...
 
DistanceType worstDist () const
 The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value. More...
 

Protected Attributes

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

Detailed Description

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

Class that holds the radius nearest neighbors It is more accurate than RadiusResult as it is not limited in the number of neighbors.

Constructor & Destructor Documentation

template<typename DistanceType>
cvflann::RadiusUniqueResultSet< DistanceType >::RadiusUniqueResultSet ( DistanceType  radius)
inline

Constructor.

Parameters
radiusthe maximum distance of a neighbor

Member Function Documentation

template<typename DistanceType>
void cvflann::RadiusUniqueResultSet< 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::RadiusUniqueResultSet< DistanceType >::clear ( )
inlinevirtual

Remove all elements in the set.

Implements cvflann::UniqueResultSet< DistanceType >.

Referenced by cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().

Here is the caller graph for this function:

template<typename DistanceType >
virtual void cvflann::UniqueResultSet< DistanceType >::copy ( int *  indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const
inlinevirtualinherited

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

Referenced by cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), cvflann::LshIndex< Distance >::knnSearch(), and cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().

Here is the caller graph for this function:

template<typename DistanceType>
bool cvflann::RadiusUniqueResultSet< DistanceType >::full ( ) const
inlinevirtual

Check the status of the set.

Returns
alwys false

Reimplemented from cvflann::UniqueResultSet< DistanceType >.

template<typename DistanceType >
size_t cvflann::UniqueResultSet< DistanceType >::size ( ) const
inlineinherited

The number of neighbors in the set.

Returns

Referenced by cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().

Here is the caller graph for this function:

template<typename DistanceType >
virtual void cvflann::UniqueResultSet< DistanceType >::sortAndCopy ( int *  indices,
DistanceType *  dist,
int  n_neighbors = -1 
) const
inlinevirtualinherited

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

Referenced by cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), cvflann::LshIndex< Distance >::knnSearch(), and cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().

Here is the caller graph for this function:

template<typename DistanceType>
DistanceType cvflann::RadiusUniqueResultSet< DistanceType >::worstDist ( ) const
inlinevirtual

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

Returns

Reimplemented from cvflann::UniqueResultSet< DistanceType >.

Member Data Documentation

template<typename DistanceType >
std::set<DistIndex> cvflann::UniqueResultSet< DistanceType >::dist_indices_
protectedinherited

The best candidates so far.

template<typename DistanceType >
bool cvflann::UniqueResultSet< DistanceType >::is_full_
protectedinherited

Flag to say if the set is full.

template<typename DistanceType >
DistanceType cvflann::UniqueResultSet< DistanceType >::worst_distance_
protectedinherited

The worst distance found so far.


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