示例#1
0
        /// <summary>
        /// 最適ビン優先(Best-Bin-First)探索を用いて,与えられたベクトルのおおよその k 近傍値を求める
        /// </summary>
        /// <param name="tr">参照ベクトルに対するk-d木インデックスへのポインタ.</param>
        /// <param name="desc">(行)ベクトルの m × d 行列.これらのベクトルの近傍値を探索する.</param>
        /// <param name="results">一致したベクトルの行インデックス (cvCreateFeatureTreeに引数として渡される行列を参照する) の集合.m × kの行列.k 近傍より遠い場合は,その列には -1 が入る.</param>
        /// <param name="dist">k 近傍値までの距離のm × k 行列.</param>
        /// <param name="k">検出される近傍の数.</param>
        /// <param name="emax">探索する葉の最大数.</param>
#else
        /// <summary>
        /// Finds approximate k nearest neighbors of given vectors using best-bin-first search.
        /// </summary>
        /// <param name="tr">pointer to kd-tree index of reference vectors. </param>
        /// <param name="desc">m x d matrix of (row-)vectors to find the nearest neighbors of. </param>
        /// <param name="results">m x k set of row indices of matching vectors (referring to matrix passed to cvCreateFeatureTree). Contains -1 in some columns if fewer than k neighbors found. </param>
        /// <param name="dist">m x k matrix of distances to k nearest neighbors. </param>
        /// <param name="k">The number of neighbors to find. </param>
        /// <param name="emax">The maximum number of leaves to visit. </param>
#endif
        public static void FindFeatures(CvFeatureTree tr, CvMat desc, CvMat results, CvMat dist, int k, int emax)
        {
            if (tr == null)
                throw new ArgumentNullException("tr");
            if (desc == null)
                throw new ArgumentNullException("desc");
            if (results == null)
                throw new ArgumentNullException("results");
            if (dist == null)
                throw new ArgumentNullException("dist");
            NativeMethods.cvFindFeatures(tr.CvPtr, desc.CvPtr, results.CvPtr, dist.CvPtr, k, emax);
        }
示例#2
0
        /// <summary>
        /// 与えられたk-d木上で直交領域探索を行う.
        /// </summary>
        /// <param name="tr">参照ベクトルに対するk-d木インデックスへのポインタ.</param>
        /// <param name="boundsMin">各次元の最小値を与える 1×d あるいは d×1 のベクトル(CV_32FC1 or CV_64FC1)</param>
        /// <param name="boundsMax">各次元の最大値を与える 1×d あるいは d×1 のベクトル(CV_32FC1 or CV_64FC1)</param>
        /// <param name="result">出力行インデックス(cvCreateFeatureTreeに引数として渡される行列を参照する) の 1×m あるいは m×1 のベクトル(CV_32SC1)</param>
        /// <returns>求められたベクトル数</returns>
#else
        /// <summary>
        /// Performs orthogonal range seaching on the given kd-tree.
        /// </summary>
        /// <param name="tr">Pointer to kd-tree index of reference vectors. </param>
        /// <param name="boundsMin">1 x d or d x 1 vector (CV_32FC1 or CV_64FC1) giving minimum value for each dimension. </param>
        /// <param name="boundsMax">1 x d or d x 1 vector (CV_32FC1 or CV_64FC1) giving maximum value for each dimension. </param>
        /// <param name="result">1 x m or m x 1 vector (CV_32SC1) to contain output row indices (referring to matrix passed to cvCreateFeatureTree). </param>
        /// <returns>the number of such vectors found. </returns>
#endif
        public static int FindFeaturesBoxed(CvFeatureTree tr, CvMat boundsMin, CvMat boundsMax, CvMat result)
        {
            if (tr == null)
                throw new ArgumentNullException("tr");
            if (boundsMin == null)
                throw new ArgumentNullException("boundsMin");
            if (boundsMax == null)
                throw new ArgumentNullException("boundsMax");
            if (result == null)
                throw new ArgumentNullException("result");
            return NativeMethods.cvFindFeaturesBoxed(tr.CvPtr, boundsMin.CvPtr, boundsMax.CvPtr, result.CvPtr);
        }
示例#3
0
        /// <summary>
        /// 最適ビン優先(Best-Bin-First)探索を用いて,与えられたベクトルのおおよその k 近傍値を求める
        /// </summary>
        /// <param name="tr">参照ベクトルに対するk-d木インデックスへのポインタ.</param>
        /// <param name="desc">(行)ベクトルの m × d 行列.これらのベクトルの近傍値を探索する.</param>
        /// <param name="results">一致したベクトルの行インデックス (cvCreateFeatureTreeに引数として渡される行列を参照する) の集合.m × kの行列.k 近傍より遠い場合は,その列には -1 が入る.</param>
        /// <param name="dist">k 近傍値までの距離のm × k 行列.</param>
        /// <param name="k">検出される近傍の数.</param>
#else
        /// <summary>
        /// Finds approximate k nearest neighbors of given vectors using best-bin-first search.
        /// </summary>
        /// <param name="tr">pointer to kd-tree index of reference vectors. </param>
        /// <param name="desc">m x d matrix of (row-)vectors to find the nearest neighbors of. </param>
        /// <param name="results">m x k set of row indices of matching vectors (referring to matrix passed to cvCreateFeatureTree). Contains -1 in some columns if fewer than k neighbors found. </param>
        /// <param name="dist">m x k matrix of distances to k nearest neighbors. </param>
        /// <param name="k">The number of neighbors to find. </param>
#endif
        public static void FindFeatures(CvFeatureTree tr, CvMat desc, CvMat results, CvMat dist, int k)
        {
            FindFeatures(tr, desc, results, dist, k, 20);
        }