Show / Hide Table of Contents

Class Index

The FLANN nearest neighbor index class.

Inheritance
System.Object
DisposableObject
DisposableCvObject
Index
Implements
ICvPtrHolder
Inherited Members
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.DisposeManaged()
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp.Flann
Assembly: OpenCvSharp.dll
Syntax
public class Index : DisposableCvObject, ICvPtrHolder

Constructors

| Improve this Doc View Source

Index(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 Source

DisposeUnmanaged()

Releases unmanaged resources

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

KnnSearch(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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX