/* * /// <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="modelIdx">The model index. A n x <paramref name="k"/> matrix where n = <paramref name="queryDescriptors"/>.Cols</param> /// <param name="distance">The matrix where the distance valus is stored. A n x <paramref name="k"/> matrix where n = <paramref name="queryDescriptors"/>.Size.Height</param> /// <param name="k">The number of nearest neighbours to be searched</param> /// <param name="mask">The mask</param> /// <param name="stream">Use a Stream to call the function asynchronously (non-blocking) or null to call the function synchronously (blocking).</param> public void KnnMatchSingle(OclMat <T> queryDescriptors, OclMat <T> modelDescriptors, OclMat <int> modelIdx, OclMat <float> distance, int k, OclMat <Byte> mask) { /* * if (k == 2 && !(modelIdx.IsContinuous && distance.IsContinuous)) * { * throw new ArgumentException("For k == 2, the allocated index matrix and distance matrix must be continuous"); * }*/ OclInvoke.oclBruteForceMatcherKnnMatchSingle(_ptr, queryDescriptors, modelDescriptors, modelIdx, distance, k, mask); }