Esempio n. 1
0
 /// <summary>
 /// Find the k-nearest match
 /// </summary>
 /// <param name="queryDescriptor">An n x m matrix of descriptors to be query for nearest neighbours. n is the number of descriptor and m is the size of the descriptor</param>
 /// <param name="k">Number of nearest neighbors to search for</param>
 /// <param name="mask">Can be null if not needed. An n x 1 matrix. If 0, the query descriptor in the corresponding row will be ignored.</param>
 /// <param name="matches">Matches. Each matches[i] is k or less matches for the same query descriptor.</param>
 /// <param name="compactResult">
 /// Parameter used when the mask (or masks) is not empty. If compactResult is
 /// false, the matches vector has the same size as queryDescriptors rows.If compactResult is true,
 /// the matches vector does not contain matches for fully masked-out query descriptors.
 /// </param>
 public void KnnMatch(
     IInputArray queryDescriptor,
     VectorOfVectorOfDMatch matches,
     int k,
     IInputArray mask   = null,
     bool compactResult = false)
 {
     using (InputArray iaQueryDesccriptor = queryDescriptor.GetInputArray())
         using (InputArray iaMask = mask == null ? InputArray.GetEmpty() : mask.GetInputArray())
             Features2DInvoke.cveDescriptorMatcherKnnMatch2(_descriptorMatcherPtr, iaQueryDesccriptor, matches, k, iaMask, compactResult);
 }