コード例 #1
0
        /// <summary>
        /// 現在の SVM パラメータを返す
        /// </summary>
        /// <returns></returns>
#else
        /// <summary>
        /// Returns current SVM parameters
        /// </summary>
        /// <returns></returns>
#endif
        public CvSVMParams GetParams()
        {
            var p = new WCvSVMParams();

            NativeMethods.ml_CvSVM_get_params(ptr, ref p);
            return(new CvSVMParams(p));
        }
コード例 #2
0
        /// <summary>
        /// 初期化
        /// </summary>
        /// <param name="svmType">SVMの種類</param>
        /// <param name="kernelType">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="classWeights">SVMType.CSvc 用</param>
        /// <param name="termCrit">終了条件</param>
#else
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="svmType">Type of SVM</param>
        /// <param name="kernelType">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="classWeights">for SVMType.CSvc</param>
        /// <param name="termCrit">Termination criteria</param>
#endif
        public CvSVMParams(SVMType svmType, SVMKernelType kernelType, double degree,
                           double gamma, double coef0, double c, double nu, double p,
                           CvMat classWeights, CvTermCriteria termCrit)
        {
            data = new WCvSVMParams();
            NativeMethods.ml_CvSVMParams_new2(
                ref data, (int)svmType, (int)kernelType, degree, gamma, coef0,
                c, nu, p, Cv2.ToPtr(classWeights), termCrit);
        }
コード例 #3
0
ファイル: CvSVM.cs プロジェクト: MJunak/opencvsharp
        /// <summary>
	    /// 現在の SVM パラメータを返す
	    /// </summary>
	    /// <returns></returns>
#else
		/// <summary>
	    /// Returns current SVM parameters
	    /// </summary>
	    /// <returns></returns>
#endif
	    public CvSVMParams GetParams()
	    {
            var p = new WCvSVMParams();
            NativeMethods.ml_CvSVM_get_params(ptr, ref p);
            return new CvSVMParams(p);
	    }
コード例 #4
0
 public static extern void ml_CvSVM_get_params(IntPtr model, ref WCvSVMParams p);
コード例 #5
0
 public static extern int ml_CvSVM_train_auto_Mat(
     IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx,
     IntPtr sampleIdx, WCvSVMParams param, int kFold, CvParamGrid cGrid,
     CvParamGrid gammaGrid, CvParamGrid pGrid, CvParamGrid nuGrid,
     CvParamGrid coefGrid, CvParamGrid degreeGrid, int balanced);
コード例 #6
0
 public static extern int ml_CvSVM_train_Mat(
     IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx,
     IntPtr sampleIdx, WCvSVMParams param);
コード例 #7
0
 public static extern IntPtr ml_CvSVM_new2_Mat(
     IntPtr trainData, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, WCvSVMParams param);
コード例 #8
0
ファイル: CvSVMParams.cs プロジェクト: 0sv/opencvsharp
        /// <summary>
        /// 既定の初期化
        /// </summary>
#else
		/// <summary>
        /// Default constructor
        /// </summary>
#endif
        public CvSVMParams()
        {
			data = new WCvSVMParams();
            NativeMethods.ml_CvSVMParams_new1(ref data);
        }
コード例 #9
0
        /// <summary>
        /// 既定の初期化
        /// </summary>
#else
        /// <summary>
        /// Default constructor
        /// </summary>
#endif
        public CvSVMParams()
        {
            data = new WCvSVMParams();
            NativeMethods.ml_CvSVMParams_new1(ref data);
        }
コード例 #10
0
 public static extern void ml_CvSVM_get_params(IntPtr model, ref WCvSVMParams p);
コード例 #11
0
 public static extern int ml_CvSVM_train_auto_Mat(
     IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx,
     IntPtr sampleIdx, WCvSVMParams param, int kFold, CvParamGrid cGrid,
     CvParamGrid gammaGrid, CvParamGrid pGrid, CvParamGrid nuGrid,
     CvParamGrid coefGrid, CvParamGrid degreeGrid, int balanced);
コード例 #12
0
 public static extern int ml_CvSVM_train_Mat(
     IntPtr model, IntPtr trainData, IntPtr responses, IntPtr varIdx,
     IntPtr sampleIdx, WCvSVMParams param);
コード例 #13
0
 public static extern IntPtr ml_CvSVM_new2_Mat(
     IntPtr trainData, IntPtr responses, IntPtr varIdx, IntPtr sampleIdx, WCvSVMParams param);
コード例 #14
0
 public static extern void ml_CvSVMParams_new2(ref WCvSVMParams result, 
     int svmType, int kernelType, double degree, double gamma, double coef0,
     double c, double nu, double p, IntPtr classWeights, CvTermCriteria termCrit);
コード例 #15
0
 public static extern void ml_CvSVMParams_new1(ref WCvSVMParams result);
コード例 #16
0
ファイル: CvSVMParams.cs プロジェクト: 0sv/opencvsharp
        /// <summary>
	    /// 初期化
	    /// </summary>
        /// <param name="svmType">SVMの種類</param>
        /// <param name="kernelType">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="classWeights">SVMType.CSvc 用</param>
        /// <param name="termCrit">終了条件</param>
#else
		/// <summary>
	    /// Constructor
	    /// </summary>
	    /// <param name="svmType">Type of SVM</param>
	    /// <param name="kernelType">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="classWeights">for SVMType.CSvc</param>
	    /// <param name="termCrit">Termination criteria</param>
#endif
		public CvSVMParams(SVMType svmType, SVMKernelType kernelType, double degree, 
            double gamma, double coef0, double c, double nu, double p, 
            CvMat classWeights, CvTermCriteria termCrit )
	    {
            data = new WCvSVMParams();
            NativeMethods.ml_CvSVMParams_new2(
                ref data, (int)svmType, (int)kernelType, degree, gamma, coef0,
                c, nu, p, Cv2.ToPtr(classWeights), termCrit);
	    }
コード例 #17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="data"></param>
 internal CvSVMParams(WCvSVMParams data)
 {
     this.data = data;
 }
コード例 #18
0
 public static extern void ml_CvSVMParams_new1(ref WCvSVMParams result);
コード例 #19
0
 public static extern void ml_CvSVMParams_new2(ref WCvSVMParams result,
                                               int svmType, int kernelType, double degree, double gamma, double coef0,
                                               double c, double nu, double p, IntPtr classWeights, CvTermCriteria termCrit);
コード例 #20
0
ファイル: CvSVMParams.cs プロジェクト: 0sv/opencvsharp
 /// <summary>
 /// 
 /// </summary>
 /// <param name="data"></param>
 internal CvSVMParams(WCvSVMParams data)
 {
     this.data = data;
 }