Emgu.CV.FeatureTree.FindFeatures C# (CSharp) Метод

FindFeatures() публичный Метод

Finds (with high probability) the k nearest neighbors in tr for each of the given (row-)vectors in desc, using best-bin-first searching ([Beis97]). The complexity of the entire operation is at most O(m*emax*log2(n)), where n is the number of vectors in the tree
public FindFeatures ( float descriptors, Matrix &results, Matrix &dist, int k, int emax ) : void
descriptors float The m feature descriptors to be searched from the feature tree
results Matrix /// The results of the best matched from the feature tree. A m x matrix. Contains -1 in some columns if fewer than k neighbors found. /// For each row the k neareast neighbors are not sorted. To findout the closet neighbour, look at the output matrix . ///
dist Matrix /// A m x Matrix of the distances to k nearest neighbors ///
k int The number of neighbors to find
emax int For k-d tree only: the maximum number of leaves to visit. Use 20 if not sure
Результат void
        public void FindFeatures(float[][] descriptors, out Matrix<Int32> results, out Matrix<double> dist, int k, int emax)
        {
            int numberOfDescriptors = descriptors.Length;
             results = new Matrix<Int32>(numberOfDescriptors, k);
             dist = new Matrix<double>(numberOfDescriptors, k);
             FindFeatures(descriptors, results, dist, k, emax);
        }

Usage Example

Пример #1
0
        public void TestKDTree()
        {
            float[][] features = new float[10][];
             for (int i = 0; i < features.Length; i++)
            features[i] = new float[] { (float)i };
             FeatureTree tree = new FeatureTree(features);

             Matrix<Int32> result;
             Matrix<double> distance;
             float[][] features2 = new float[1][];
             features2[0] = new float[] { 5.0f };

             tree.FindFeatures(features2, out result, out distance, 1, 20);
             Assert.AreEqual(result[0, 0], 5);
             Assert.AreEqual(distance[0, 0], 0.0);
        }
All Usage Examples Of Emgu.CV.FeatureTree::FindFeatures