Exemple #1
0
        /// <summary>
        /// 初期化
        /// </summary>
#else
		/// <summary>
		/// Default constructor
		/// </summary>
#endif
        public CvEMParams()
        {
            _data = new WCvEMParams()
            {
                nclusters = 10,
                cov_mat_type = 1,
                start_step = 0,
                probs = null,
                weights = null,
                means = null,
                //covs = null
            };
            Covs = null;
        }
Exemple #2
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="_nclusters">混合数</param>
        /// <param name="_cov_mat_type">混合分布共変動行列のタイプ</param>
        /// <param name="_start_step">アルゴリズムをスタートする最初のステップ</param>
        /// <param name="_term_crit">処理の終了条件</param>
        /// <param name="_probs">確率p_i,kの初期値. start_step=EMStartStep.Eのときのみ使用する(その場合はnullであってはならない).</param>
        /// <param name="_weights">混合分布の重みπ_kの初期値. start_step=EMStartStep.Eのときのみ(nullでない場合は)使用する. </param>
        /// <param name="_means">混合分布の平均 a_kの初期値. start_step=EMStartStep.Eのときのみ使用する(その場合はnullであってはならない).</param>
        /// <param name="_covs">混合分布の共変動行列Skの初期値. start_step=EMStartStep.Eのときのみ(nullでない場合は)使用する.</param>
#else
		/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="_nclusters">The number of mixtures. Some of EM implementation could determine the optimal number of mixtures within a specified value range, but that is not the case in ML yet. </param>
        /// <param name="_cov_mat_type">The type of the mixture covariation matrices</param>
        /// <param name="_start_step">The initial step the algorithm starts from</param>
        /// <param name="_term_crit">Termination criteria of the procedure. </param>
        /// <param name="_probs">Initial probabilities p_i,k; are used (and must be not null) only when start_step=EMStartStep.E. </param>
        /// <param name="_weights">Initial mixture weights π_k; are used (if not null) only when start_step=EMStartStep.E. </param>
        /// <param name="_means">Initial mixture means a_k; are used (and must be not null) only when start_step=EMStartStep.E. </param>
        /// <param name="_covs">Initial mixture covariation matrices S_k; are used (if not null) only when start_step=EMStartStep.E. </param>
#endif
		public CvEMParams(int _nclusters, EMCovMatType _cov_mat_type, EMStartStep _start_step, CvTermCriteria _term_crit, 
            CvMat _probs, CvMat _weights, CvMat _means, CvMat[] _covs ) 
        {
            unsafe
            {
                _data = new WCvEMParams()
                {
                    nclusters = _nclusters,
                    cov_mat_type = (int)_cov_mat_type,
                    start_step = (int)_start_step,
                    term_crit = _term_crit,
                    probs = (_probs == null) ? null : _probs.CvPtr.ToPointer(),
                    weights = (_weights == null) ? null : _weights.CvPtr.ToPointer(),
                    means = (_means == null) ? null : _means.CvPtr.ToPointer(),
                    //covs = (_means == null) ? null : (void**)_means.CvPtr,
                };
            }
            Covs = _covs;
        }