1 
2 //
3 // This file is auto-generated. Please don't modify it!
4 //
5 package org.opencv.ml;
6 
7 import org.opencv.core.Algorithm;
8 import org.opencv.core.Mat;
9 
10 // C++: class StatModel
11 //javadoc: StatModel
12 public class StatModel extends Algorithm {
13 
StatModel(long addr)14     protected StatModel(long addr) { super(addr); }
15 
16 
17     public static final int
18             UPDATE_MODEL = 1,
19             RAW_OUTPUT = 1,
20             COMPRESSED_INPUT = 2,
21             PREPROCESSED_INPUT = 4;
22 
23 
24     //
25     // C++:  int getVarCount()
26     //
27 
28     //javadoc: StatModel::getVarCount()
getVarCount()29     public  int getVarCount()
30     {
31 
32         int retVal = getVarCount_0(nativeObj);
33 
34         return retVal;
35     }
36 
37 
38     //
39     // C++:  bool empty()
40     //
41 
42     //javadoc: StatModel::empty()
empty()43     public  boolean empty()
44     {
45 
46         boolean retVal = empty_0(nativeObj);
47 
48         return retVal;
49     }
50 
51 
52     //
53     // C++:  bool isTrained()
54     //
55 
56     //javadoc: StatModel::isTrained()
isTrained()57     public  boolean isTrained()
58     {
59 
60         boolean retVal = isTrained_0(nativeObj);
61 
62         return retVal;
63     }
64 
65 
66     //
67     // C++:  bool isClassifier()
68     //
69 
70     //javadoc: StatModel::isClassifier()
isClassifier()71     public  boolean isClassifier()
72     {
73 
74         boolean retVal = isClassifier_0(nativeObj);
75 
76         return retVal;
77     }
78 
79 
80     //
81     // C++:  bool train(Ptr_TrainData trainData, int flags = 0)
82     //
83 
84     // Unknown type 'Ptr_TrainData' (I), skipping the function
85 
86 
87     //
88     // C++:  bool train(Mat samples, int layout, Mat responses)
89     //
90 
91     //javadoc: StatModel::train(samples, layout, responses)
train(Mat samples, int layout, Mat responses)92     public  boolean train(Mat samples, int layout, Mat responses)
93     {
94 
95         boolean retVal = train_0(nativeObj, samples.nativeObj, layout, responses.nativeObj);
96 
97         return retVal;
98     }
99 
100 
101     //
102     // C++:  float calcError(Ptr_TrainData data, bool test, Mat& resp)
103     //
104 
105     // Unknown type 'Ptr_TrainData' (I), skipping the function
106 
107 
108     //
109     // C++:  float predict(Mat samples, Mat& results = Mat(), int flags = 0)
110     //
111 
112     //javadoc: StatModel::predict(samples, results, flags)
predict(Mat samples, Mat results, int flags)113     public  float predict(Mat samples, Mat results, int flags)
114     {
115 
116         float retVal = predict_0(nativeObj, samples.nativeObj, results.nativeObj, flags);
117 
118         return retVal;
119     }
120 
121     //javadoc: StatModel::predict(samples)
predict(Mat samples)122     public  float predict(Mat samples)
123     {
124 
125         float retVal = predict_1(nativeObj, samples.nativeObj);
126 
127         return retVal;
128     }
129 
130 
131     @Override
finalize()132     protected void finalize() throws Throwable {
133         delete(nativeObj);
134     }
135 
136 
137 
138     // C++:  int getVarCount()
getVarCount_0(long nativeObj)139     private static native int getVarCount_0(long nativeObj);
140 
141     // C++:  bool empty()
empty_0(long nativeObj)142     private static native boolean empty_0(long nativeObj);
143 
144     // C++:  bool isTrained()
isTrained_0(long nativeObj)145     private static native boolean isTrained_0(long nativeObj);
146 
147     // C++:  bool isClassifier()
isClassifier_0(long nativeObj)148     private static native boolean isClassifier_0(long nativeObj);
149 
150     // C++:  bool train(Mat samples, int layout, Mat responses)
train_0(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj)151     private static native boolean train_0(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj);
152 
153     // C++:  float predict(Mat samples, Mat& results = Mat(), int flags = 0)
predict_0(long nativeObj, long samples_nativeObj, long results_nativeObj, int flags)154     private static native float predict_0(long nativeObj, long samples_nativeObj, long results_nativeObj, int flags);
predict_1(long nativeObj, long samples_nativeObj)155     private static native float predict_1(long nativeObj, long samples_nativeObj);
156 
157     // native support for java finalize()
delete(long nativeObj)158     private static native void delete(long nativeObj);
159 
160 }
161