예제 #1
0
        /*
         * /// <summary>
         * /// Add the model descriptors
         * /// </summary>
         * /// <param name="modelDescriptors">The model discriptors</param>
         * public void Add(Matrix<Byte> modelDescriptors)
         * {
         * if (!(_distanceType == DistanceType.HammingDist))
         *    throw new ArgumentException("Hamming distance type requires model descriptor to be Matrix<Byte>");
         * gpuBruteForceMatcherAdd(_ptr, modelDescriptors);
         * }
         *
         * /// <summary>
         * /// Add the model descriptors
         * /// </summary>
         * /// <param name="modelDescriptors">The model discriptors</param>
         * public void Add(Matrix<float> modelDescriptors)
         * {
         * if (!(_distanceType == DistanceType.L2 || _distanceType == DistanceType.L1))
         *    throw new ArgumentException("L1 / L2 distance type requires model descriptor to be Matrix<float>");
         * gpuBruteForceMatcherAdd(_ptr, modelDescriptors);
         * }*/

        /// <summary>
        /// Find the k nearest neighbour using the brute force matcher.
        /// </summary>
        /// <param name="queryDescriptors">The query descriptors</param>
        /// <param name="modelDescriptors">The model descriptors</param>

        /// <param name="k">The number of nearest neighbours to be searched</param>
        /// <param name="mask">The mask</param>

        public void KnnMatch(GpuMat queryDescriptors, GpuMat modelDescriptors, VectorOfVectorOfDMatch matches, int k, GpuMat mask = null, bool compactResult = false)
        {
            CudaInvoke.cudaBruteForceMatcherKnnMatch(_ptr, queryDescriptors, modelDescriptors, matches, k, mask, compactResult);
        }