/// <summary> /// 与えられたデータセットの最近傍探索インデックスを作成します. /// </summary> /// <param name="features">インデックス作成対象となる特徴(点)が格納された, CV_32F 型の行列.この行列のサイズは matrix is num _ features x feature _ dimensionality となります</param> /// <param name="params">params – インデックスパラメータを含む構造体.作成されるインデックスの種類は,このパラメータの種類に依存します</param> #else /// <summary> /// Constructs a nearest neighbor search index for a given dataset. /// </summary> /// <param name="features">features – Matrix of type CV _ 32F containing the features(points) to index. The size of the matrix is num _ features x feature _ dimensionality.</param> /// <param name="params">Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. </param> #endif public Index(Mat features, IndexParams @params) { if (features == null) throw new ArgumentNullException("features"); if (@params == null) throw new ArgumentNullException("params"); ptr = NativeMethods.flann_Index_construct(features.CvPtr, @params.CvPtr); if (ptr == IntPtr.Zero) throw new OpenCvSharpException("Failed to create Index"); }
/// <summary> /// 与えられたデータセットの最近傍探索インデックスを作成します. /// </summary> /// <param name="features">インデックス作成対象となる特徴(点)が格納された, CV_32F 型の行列.この行列のサイズは matrix is num _ features x feature _ dimensionality となります</param> /// <param name="params">params – インデックスパラメータを含む構造体.作成されるインデックスの種類は,このパラメータの種類に依存します</param> #else /// <summary> /// Constructs a nearest neighbor search index for a given dataset. /// </summary> /// <param name="features">features – Matrix of type CV _ 32F containing the features(points) to index. The size of the matrix is num _ features x feature _ dimensionality.</param> /// <param name="params">Structure containing the index parameters. The type of index that will be constructed depends on the type of this parameter. </param> #endif public Index(Mat features, IndexParams @params) { if (features == null) { throw new ArgumentNullException("features"); } if (@params == null) { throw new ArgumentNullException("params"); } ptr = NativeMethods.flann_Index_construct(features.CvPtr, @params.CvPtr); if (ptr == IntPtr.Zero) { throw new OpenCvSharpException("Failed to create Index"); } }
/// <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)); }