Exemple #1
0
        /// <summary>
        /// 入力オブジェクトのすべての分解係数を計算する.
        /// </summary>
        /// <param name="obj">入力オブジェクト</param>
        /// <param name="eigenvec_count">固有オブジェクトの個数.</param>
        /// <param name="eigInput">読み込みコールバック関数.</param>
        /// <param name="ioFlags">入出力フラグ.</param>
        /// <param name="userData">コールバック関数に必要なすべてのデータを含む構造体へのポインタ.</param>
        /// <param name="avg">平均オブジェクト.</param>
        /// <param name="coeffs">計算された係数; 出力パラメータ.</param>
#else
        /// <summary>
        /// Calculates all of the decomposition coefficients for an input object.
        /// </summary>
        /// <param name="obj">Input object.</param>
        /// <param name="eigenvec_count">Number of eigen objects.</param>
        /// <param name="eigInput">ointer to the read callback function.</param>
        /// <param name="ioFlags">Input/output flags.</param>
        /// <param name="userData">Pointer to the structure that contains all of the necessary data for the callback functions.</param>
        /// <param name="avg">Averaged object.</param>
        /// <param name="coeffs">Calculated coefficients; an output parameter.</param>
#endif
        public static void EigenDecomposite(IplImage obj, int eigenvec_count, CvCallback eigInput, EigenObjectsIOFlag ioFlags, IntPtr userData, IplImage avg, float[] coeffs)
        {
            if (obj == null)
                throw new ArgumentNullException("obj");
            if (avg == null)
                throw new ArgumentNullException("avg");

            using (ScopedGCHandle eigInputhandle = ScopedGCHandle.Alloc(eigInput, GCHandleType.Normal))
            {
                CvInvoke.cvEigenDecomposite(obj.CvPtr, eigenvec_count, eigInput, ioFlags, userData, avg.CvPtr, coeffs);
            }
        }
Exemple #2
0
        /// <summary>
        /// オブジェクトの固有部分空間への投影を計算する
        /// </summary>
        /// <param name="input_vecs">コールバック関数</param>
        /// <param name="eigenvec_count">固有ベクトルの個数. </param>
        /// <param name="io_flags">入出力フラグ.</param>
        /// <param name="userdata">コールバック関数に必要なすべてのデータを含む構造体へのポインタ.</param>
        /// <param name="coeffs">事前に計算された分解係数. </param>
        /// <param name="avg">cvCalcEigenObjects  によって計算された平均ベクトル.</param>
        /// <param name="proj">固有部分空間への投影.</param>
#else
        /// <summary>
        /// Calculates the object projection into the eigen sub-space.
        /// </summary>
        /// <param name="input_vecs">Pointer to to a callback function, depending on io_flags.</param>
        /// <param name="eigenvec_count">Number of eigenvectors.</param>
        /// <param name="io_flags">Input/output flags</param>
        /// <param name="userdata">Pointer to the structure that contains all of the necessary data for the callback functions.</param>
        /// <param name="coeffs">Previously calculated decomposition coefficients.</param>
        /// <param name="avg">Average vector</param>
        /// <param name="proj">Projection to the eigen sub-space.</param>
#endif
        public static void EigenProjection(CvCallback input_vecs, int eigenvec_count, EigenObjectsIOFlag io_flags, IntPtr userdata, float[] coeffs, IplImage avg, IplImage proj)
        {
            if (avg == null)
                throw new ArgumentNullException("avg");
            if (proj == null)
                throw new ArgumentNullException("proj");

            using (ScopedGCHandle inputVecsHandle = ScopedGCHandle.Alloc(input_vecs, GCHandleType.Normal))
            {
                CvInvoke.cvEigenProjection(input_vecs, eigenvec_count, io_flags, userdata, coeffs, avg.CvPtr, proj.CvPtr);
            }
        }
Exemple #3
0
 public static extern void cvEigenProjection(CvCallback input_vecs, int eigenvec_count, [MarshalAs(UnmanagedType.I4)] EigenObjectsIOFlag io_flags, IntPtr userdata, float[] coeffs, IntPtr avg, IntPtr proj);
Exemple #4
0
 public static extern void cvEigenDecomposite(IntPtr obj, int eigenvec_count, CvCallback eigInput, [MarshalAs(UnmanagedType.I4)] EigenObjectsIOFlag ioFlags, IntPtr userData, IntPtr avg, [In] float[] coeffs);
Exemple #5
0
 public static extern void cvCalcEigenObjects(int nObjects, CvCallback input, CvCallback output, [MarshalAs(UnmanagedType.I4)] EigenObjectsIOFlag ioFlags,
                  int ioBufSize, IntPtr userData, ref CvTermCriteria calcLimit, IntPtr avg, [In] float[] eigVals);
Exemple #6
0
 public static extern void cvCalcCovarMatrixEx(int object_count, CvCallback input, [MarshalAs(UnmanagedType.I4)] EigenObjectsIOFlag io_flags, int iobuf_size,
     [MarshalAs(UnmanagedType.LPArray)] byte[] buffer, IntPtr userdata, IntPtr avg, [In] float[] covar_matrix);