Class Index
Flann index
public class Index : UnmanagedObject, IDisposable
- Inheritance
-
Index
- Implements
- Inherited Members
Constructors
Index(IInputArray, IIndexParams, DistType)
Create a flann index
public Index(IInputArray values, IIndexParams ip, DistType distType = DistType.Euclidean)
Parameters
values
IInputArrayA row by row matrix of descriptors
ip
IIndexParamsThe index parameter
distType
DistTypeThe distance type
Methods
DisposeObject()
Release the unmanaged memory associated with this Flann Index
protected override void DisposeObject()
KnnSearch(IInputArray, IOutputArray, IOutputArray, int, int, float, bool)
Perform k-nearest-neighbours (KNN) search
public void KnnSearch(IInputArray queries, IOutputArray indices, IOutputArray squareDistances, int knn, int checks = 32, float eps = 0, bool sorted = true)
Parameters
queries
IInputArrayA row by row matrix of descriptors to be query for nearest neighbours
indices
IOutputArrayThe result of the indices of the k-nearest neighbours
squareDistances
IOutputArrayThe square of the Eculidean distance between the neighbours
knn
intNumber of nearest neighbors to search for
checks
intThe number of times the tree(s) in the index should be recursively traversed. A higher value for this parameter would give better search precision, but also take more time. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, in which case this parameter is ignored
eps
floatThe search epsilon
sorted
boolIf set to true, the search result is sorted
RadiusSearch(IInputArray, IOutputArray, IOutputArray, double, int, int, float, bool)
Performs a radius nearest neighbor search for multiple query points
public int RadiusSearch(IInputArray queries, IOutputArray indices, IOutputArray squareDistances, double radius, int maxResults, int checks = 32, float eps = 0, bool sorted = true)
Parameters
queries
IInputArrayThe query points, one per row
indices
IOutputArrayIndices of the nearest neighbors found
squareDistances
IOutputArrayThe square of the Eculidean distance between the neighbours
radius
doubleThe search radius
maxResults
intThe maximum number of results
checks
intThe number of times the tree(s) in the index should be recursively traversed. A higher value for this parameter would give better search precision, but also take more time. If automatic configuration was used when the index was created, the number of checks required to achieve the specified precision was also computed, in which case this parameter is ignored
eps
floatThe search epsilon
sorted
boolIf set to true, the search result is sorted
Returns
- int
The number of points in the search radius