Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays. More...
#include <opencv2/flann/result_set.h>
Classes | |
struct | DistIndex |
Public Member Functions | |
UniqueResultSet () | |
Default cosntructor. More... | |
virtual void | addPoint (DistanceType dist, int index)=0 |
virtual void | clear ()=0 |
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 CV_OVERRIDE |
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 CV_OVERRIDE |
The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value. More... | |
Protected Attributes | |
std::set< DistIndex > | dist_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... | |
Class that holds the k NN neighbors Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays.
|
inline |
Default cosntructor.
|
pure virtualinherited |
Implemented in cvflann::RadiusUniqueResultSet< DistanceType >, cvflann::KNNUniqueResultSet< DistanceType >, cvflann::RadiusResultSet< DistanceType >, cvflann::KNNResultSet< DistanceType >, and cvflann::KNNSimpleResultSet< DistanceType >.
Referenced by cvflann::LshIndex< Distance >::findNeighbors(), cvflann::KDTreeSingleIndex< Distance >::findNeighbors(), cvflann::KDTreeIndex< Distance >::getParameters(), cvflann::KMeansIndex< Distance >::getParameters(), and cvflann::HierarchicalClusteringIndex< Distance >::getParameters().
|
pure virtual |
Remove all elements in the set.
Implemented in cvflann::KNNRadiusUniqueResultSet< DistanceType >, cvflann::RadiusUniqueResultSet< DistanceType >, and cvflann::KNNUniqueResultSet< DistanceType >.
|
inlinevirtual |
Copy the set to two C arrays.
indices | pointer to a C array of indices |
dist | pointer to a C array of distances |
n_neighbors | the number of neighbors to copy |
Referenced by cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), cvflann::LshIndex< Distance >::knnSearch(), and cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().
|
inlinevirtual |
Check the status of the set.
Implements cvflann::ResultSet< DistanceType >.
Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.
|
inline |
The number of neighbors in the set.
Referenced by cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().
|
inlinevirtual |
Copy the set to two C arrays but sort it according to the distance first.
indices | pointer to a C array of indices |
dist | pointer to a C array of distances |
n_neighbors | the number of neighbors to copy |
Referenced by cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), cvflann::LshIndex< Distance >::knnSearch(), and cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().
|
inlinevirtual |
The distance of the furthest neighbor If we don't have enough neighbors, it returns the max possible value.
Implements cvflann::ResultSet< DistanceType >.
Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.
|
protected |
The best candidates so far.
|
protected |
Flag to say if the set is full.
|
protected |
The worst distance found so far.