예제 #1
0
파일: CvSVM.cs 프로젝트: neoxeo/opencvsharp
        /// <summary>
	    /// 現在の SVM パラメータを返す
	    /// </summary>
	    /// <returns></returns>
#else
		/// <summary>
	    /// Returns current SVM parameters
	    /// </summary>
	    /// <returns></returns>
#endif
	    public CvSVMParams GetParams()
	    {
            WCvSVMParams p = new WCvSVMParams();
            MLInvoke.CvSVM_get_params(ptr, ref p);
            return new CvSVMParams(p);
	    }
예제 #2
0
        /// <summary>
        /// 既定の初期化
        /// </summary>
#else
		/// <summary>
        /// Default constructor
        /// </summary>
#endif
        public CvSVMParams()
        {
			_data = new WCvSVMParams();
            MLInvoke.CvSVMParams_construct_default(ref _data);
        }
예제 #3
0
        /// <summary>
	    /// 初期化
	    /// </summary>
	    /// <param name="_svm_type">SVMの種類</param>
	    /// <param name="_kernel_type">SVMカーネルの種類</param>
	    /// <param name="_degree">poly 用</param>
	    /// <param name="_gamma">poly/rbf/sigmoid 用</param>
	    /// <param name="_coef0">poly/sigmoid 用</param>
	    /// <param name="_C">SVMType.CSvc, SVMType.EpsSvr, SVMType.NuSvr 用</param>
	    /// <param name="_nu">SVMType.NuSvc, SVMType.OneClass, SVMType.NuSvr 用</param>
	    /// <param name="p">SVMType.EpsSvr 用</param>
	    /// <param name="_class_weights">SVMType.CSvc 用</param>
	    /// <param name="_term_crit">終了条件</param>
#else
		/// <summary>
	    /// Constructor
	    /// </summary>
	    /// <param name="_svm_type">Type of SVM</param>
	    /// <param name="_kernel_type">The kernel type</param>
	    /// <param name="_degree">for poly</param>
	    /// <param name="_gamma">for poly/rbf/sigmoid</param>
	    /// <param name="_coef0">for poly/sigmoid</param>
	    /// <param name="_C">for SVMType.CSvc, SVMType.EpsSvr and SVMType.NuSvr</param>
	    /// <param name="_nu">for SVMType.NuSvc, SVMType.OneClass and SVMType.NuSvr</param>
	    /// <param name="_p">for SVMType.EpsSvr</param>
	    /// <param name="_class_weights">for SVMType.CSvc</param>
	    /// <param name="_term_crit">Termination criteria</param>
#endif
		public CvSVMParams(SVMType _svm_type, SVMKernelType _kernel_type, double _degree, double _gamma, double _coef0, 
            double _C, double _nu, double _p, CvMat _class_weights, CvTermCriteria _term_crit )
	    {
            _data = new WCvSVMParams();
            IntPtr _class_weights_ptr = (_class_weights == null) ? IntPtr.Zero : _class_weights.CvPtr;
            MLInvoke.CvSVMParams_construct(ref _data, (int)_svm_type, (int)_kernel_type, _degree, _gamma, _coef0, _C, _nu, _p, _class_weights_ptr, _term_crit);
	    }
예제 #4
0
 public static extern void CvSVM_get_params(IntPtr model, ref WCvSVMParams p);
예제 #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="data"></param>
 internal CvSVMParams(WCvSVMParams data)
 {
     _data = data;
 }
예제 #6
0
 public static extern bool CvSVM_train_auto(IntPtr model, IntPtr _train_data, IntPtr _responses, IntPtr _var_idx, IntPtr _sample_idx, WCvSVMParams _params,
    int k_fold, CvParamGrid C_grid, CvParamGrid gamma_grid, CvParamGrid p_grid, CvParamGrid nu_grid, CvParamGrid coef_grid, CvParamGrid degree_grid);
예제 #7
0
 public static extern bool CvSVM_train(IntPtr model, IntPtr _train_data, IntPtr _responses, IntPtr _var_idx, IntPtr _sample_idx, WCvSVMParams _params);
예제 #8
0
 public static extern IntPtr CvSVM_construct_training(IntPtr _train_data, IntPtr _responses, IntPtr _var_idx, IntPtr _sample_idx, WCvSVMParams _params);
예제 #9
0
 public static extern void CvSVMParams_construct(ref WCvSVMParams p, int _svm_type, int _kernel_type, double _degree, double _gamma, double _coef0,
                            double _C, double _nu, double _p, IntPtr _class_weights, CvTermCriteria _term_crit);
예제 #10
0
 public static extern void CvSVMParams_construct_default(ref WCvSVMParams p);