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>


Public Member Functions | |
| KNNUniqueResultSet (unsigned int capacity) | |
| Constructor. More... | |
| void | addPoint (DistanceType dist, int index) CV_OVERRIDE |
| Add a possible candidate to the best neighbors. More... | |
| void | clear () CV_OVERRIDE |
| 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 Types | |
| typedef UniqueResultSet< DistanceType >::DistIndex | DistIndex |
Protected Attributes | |
| unsigned int | capacity_ |
| The number of neighbors to keep. More... | |
| 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.
|
protected |
|
inline |
Constructor.
| capacity | the number of neighbors to store at max |
|
inlinevirtual |
Add a possible candidate to the best neighbors.
| dist | distance for that neighbor |
| index | index of that neighbor |
Implements cvflann::ResultSet< DistanceType >.
|
inlinevirtual |
Remove all elements in the set.
Implements cvflann::UniqueResultSet< DistanceType >.
Reimplemented in cvflann::KNNRadiusUniqueResultSet< DistanceType >.
References cv::max().
Referenced by cvflann::NNIndex< cv::L1< ElementType > >::knnSearch(), and cvflann::LshIndex< Distance >::knnSearch().


|
inlinevirtualinherited |
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().

|
inlinevirtualinherited |
Check the status of the set.
Implements cvflann::ResultSet< DistanceType >.
Reimplemented in cvflann::RadiusUniqueResultSet< DistanceType >.
|
inlineinherited |
The number of neighbors in the set.
Referenced by cvflann::NNIndex< cv::L1< ElementType > >::radiusSearch().

|
inlinevirtualinherited |
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().

|
inlinevirtualinherited |
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 number of neighbors to keep.
|
protectedinherited |
The best candidates so far.
|
protectedinherited |
Flag to say if the set is full.
|
protectedinherited |
The worst distance found so far.