Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="indexParams"></param>
 /// <param name="searchParams"></param>
 public FlannBasedMatcher(IndexParams indexParams = null, SearchParams searchParams = null)
 {
     ptr = NativeMethods.features2d_FlannBasedMatcher_new(
         Cv2.ToPtr(indexParams), Cv2.ToPtr(searchParams));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 複数のクエリ点に対するk-近傍探索を行います.
        /// </summary>
        /// <param name="queries">クエリ点.1行が1つの点を表します</param>
        /// <param name="indices">求められた最近傍のインデックス</param>
        /// <param name="dists">求められた最近傍までの距離</param>
        /// <param name="knn">この個数分の最近傍を求めます</param>
        /// <param name="params">探索パラメータ</param>
#else
        /// <summary>
        /// Performs a K-nearest neighbor search for multiple query points.
        /// </summary>
        /// <param name="queries">The query points, one per row</param>
        /// <param name="indices">Indices of the nearest neighbors found</param>
        /// <param name="dists">Distances to the nearest neighbors found</param>
        /// <param name="knn">Number of nearest neighbors to search for</param>
        /// <param name="params">Search parameters</param>
#endif
        public void KnnSearch(Mat queries, out int[] indices, out float[] dists, int knn, SearchParams @params)
        {
            if (queries == null)
                throw new ArgumentNullException("queries");
            if (@params == null)
                throw new ArgumentNullException("params");
            if (knn < 1)
                throw new ArgumentOutOfRangeException("knn");

            indices = new int[knn];
            dists = new float[knn];

            NativeMethods.flann_Index_knnSearch3(ptr, queries.CvPtr, indices, dists, knn, @params.CvPtr);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 与えられたクエリ点に対するradius 最近傍探索を行います.
        /// </summary>
        /// <param name="queries">クエリ点.1行が1つの点を表します [入力]</param>
        /// <param name="indices">求められた最近傍のインデックス [出力]</param>
        /// <param name="dists">求められた最近傍までの距離 [出力]</param>
        /// <param name="radius">探索範囲</param>
        /// <param name="maxResults"></param>
        /// <param name="params">探索パラメータ</param>
#else
        /// <summary>
        /// Performs a radius nearest neighbor search for a given query point.
        /// </summary>
        /// <param name="queries">The query point</param>
        /// <param name="indices">Indices of the nearest neighbors found</param>
        /// <param name="dists">Distances to the nearest neighbors found</param>
        /// <param name="radius">Number of nearest neighbors to search for</param>
        /// <param name="maxResults"></param>
        /// <param name="params">Search parameters</param>
#endif
        public void RadiusSearch(Mat queries, int[] indices, float[] dists, float radius, int maxResults, SearchParams @params)
        {
            if (queries == null)
                throw new ArgumentNullException("queries");
            if (indices == null)
                throw new ArgumentNullException("indices");
            if (dists == null)
                throw new ArgumentNullException("dists");
            if (@params == null)
                throw new ArgumentNullException("params");

            NativeMethods.flann_Index_radiusSearch3(ptr, queries.CvPtr, indices, indices.Length, dists, dists.Length, radius, maxResults, @params.CvPtr);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 複数のクエリ点に対するk-近傍探索を行います.
        /// </summary>
        /// <param name="queries">クエリ点.1行が1つの点を表します</param>
        /// <param name="indices">求められた最近傍のインデックス</param>
        /// <param name="dists">求められた最近傍までの距離</param>
        /// <param name="knn">この個数分の最近傍を求めます</param>
        /// <param name="params">探索パラメータ</param>
#else
        /// <summary>
        /// Performs a K-nearest neighbor search for multiple query points.
        /// </summary>
        /// <param name="queries">The query points, one per row</param>
        /// <param name="indices">Indices of the nearest neighbors found</param>
        /// <param name="dists">Distances to the nearest neighbors found</param>
        /// <param name="knn">Number of nearest neighbors to search for</param>
        /// <param name="params">Search parameters</param>
#endif
        public void KnnSearch(Mat queries, Mat indices, Mat dists, int knn, SearchParams @params)
        {
            if (queries == null)
                throw new ArgumentNullException("queries");
            if (indices == null)
                throw new ArgumentNullException("indices");
            if (dists == null)
                throw new ArgumentNullException("dists");
            if (@params == null)
                throw new ArgumentNullException("params");

            NativeMethods.flann_Index_knnSearch2(ptr, queries.CvPtr, indices.CvPtr, dists.CvPtr, knn, @params.CvPtr);
        }