Class Index
The FLANN nearest neighbor index class.
Implements
Inherited Members
Namespace: OpenCvSharp.Flann
Assembly: OpenCvSharp.dll
Syntax
public class Index : DisposableCvObject, ICvPtrHolder
Constructors
| Improve this Doc View SourceIndex(InputArray, IndexParams, FlannDistance)
Constructs a nearest neighbor search index for a given dataset.
Declaration
public Index(InputArray features, IndexParams params, FlannDistance distType = FlannDistance.Euclidean)
Parameters
Type | Name | Description |
---|---|---|
InputArray | features | features – Matrix of type CV _ 32F containing the features(points) to index. The size of the matrix is num _ features x feature _ dimensionality. |
IndexParams | params | Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. |
FlannDistance | distType |
Methods
| Improve this Doc View SourceDisposeUnmanaged()
Releases unmanaged resources
Declaration
protected override void DisposeUnmanaged()
Overrides
| Improve this Doc View SourceKnnSearch(Mat, Mat, Mat, Int32, SearchParams)
Performs a K-nearest neighbor search for multiple query points.
Declaration
public void KnnSearch(Mat queries, Mat indices, Mat dists, int knn, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
Mat | queries | The query points, one per row |
Mat | indices | Indices of the nearest neighbors found |
Mat | dists | Distances to the nearest neighbors found |
System.Int32 | knn | Number of nearest neighbors to search for |
SearchParams | params | Search parameters |
KnnSearch(Mat, out Int32[], out Single[], Int32, SearchParams)
Performs a K-nearest neighbor search for multiple query points.
Declaration
public void KnnSearch(Mat queries, out int[] indices, out float[] dists, int knn, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
Mat | queries | The query points, one per row |
System.Int32[] | indices | Indices of the nearest neighbors found |
System.Single[] | dists | Distances to the nearest neighbors found |
System.Int32 | knn | Number of nearest neighbors to search for |
SearchParams | params | Search parameters |
KnnSearch(Single[], out Int32[], out Single[], Int32, SearchParams)
Performs a K-nearest neighbor search for multiple query points.
Declaration
public void KnnSearch(float[] queries, out int[] indices, out float[] dists, int knn, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | queries | The query points, one per row |
System.Int32[] | indices | Indices of the nearest neighbors found |
System.Single[] | dists | Distances to the nearest neighbors found |
System.Int32 | knn | Number of nearest neighbors to search for |
SearchParams | params | Search parameters |
RadiusSearch(Mat, Mat, Mat, Double, Int32, SearchParams)
Performs a radius nearest neighbor search for a given query point.
Declaration
public void RadiusSearch(Mat queries, Mat indices, Mat dists, double radius, int maxResults, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
Mat | queries | The query point |
Mat | indices | Indices of the nearest neighbors found |
Mat | dists | Distances to the nearest neighbors found |
System.Double | radius | Number of nearest neighbors to search for |
System.Int32 | maxResults | |
SearchParams | params | Search parameters |
RadiusSearch(Mat, Int32[], Single[], Double, Int32, SearchParams)
Performs a radius nearest neighbor search for a given query point.
Declaration
public void RadiusSearch(Mat queries, int[] indices, float[] dists, double radius, int maxResults, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
Mat | queries | The query point |
System.Int32[] | indices | Indices of the nearest neighbors found |
System.Single[] | dists | Distances to the nearest neighbors found |
System.Double | radius | Number of nearest neighbors to search for |
System.Int32 | maxResults | |
SearchParams | params | Search parameters |
RadiusSearch(Single[], Int32[], Single[], Double, Int32, SearchParams)
Performs a radius nearest neighbor search for a given query point.
Declaration
public void RadiusSearch(float[] queries, int[] indices, float[] dists, double radius, int maxResults, SearchParams params)
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | queries | The query point |
System.Int32[] | indices | Indices of the nearest neighbors found |
System.Single[] | dists | Distances to the nearest neighbors found |
System.Double | radius | Number of nearest neighbors to search for |
System.Int32 | maxResults | |
SearchParams | params | Search parameters |
Save(String)
Saves the index to a file.
Declaration
public void Save(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | The file to save the index to |