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.Mat; 8 import org.opencv.core.TermCriteria; 9 10 // C++: class EM 11 //javadoc: EM 12 public class EM extends StatModel { 13 EM(long addr)14 protected EM(long addr) { super(addr); } 15 16 17 public static final int 18 COV_MAT_SPHERICAL = 0, 19 COV_MAT_DIAGONAL = 1, 20 COV_MAT_GENERIC = 2, 21 COV_MAT_DEFAULT = COV_MAT_DIAGONAL, 22 DEFAULT_NCLUSTERS = 5, 23 DEFAULT_MAX_ITERS = 100, 24 START_E_STEP = 1, 25 START_M_STEP = 2, 26 START_AUTO_STEP = 0; 27 28 29 // 30 // C++: int getClustersNumber() 31 // 32 33 //javadoc: EM::getClustersNumber() getClustersNumber()34 public int getClustersNumber() 35 { 36 37 int retVal = getClustersNumber_0(nativeObj); 38 39 return retVal; 40 } 41 42 43 // 44 // C++: void setClustersNumber(int val) 45 // 46 47 //javadoc: EM::setClustersNumber(val) setClustersNumber(int val)48 public void setClustersNumber(int val) 49 { 50 51 setClustersNumber_0(nativeObj, val); 52 53 return; 54 } 55 56 57 // 58 // C++: int getCovarianceMatrixType() 59 // 60 61 //javadoc: EM::getCovarianceMatrixType() getCovarianceMatrixType()62 public int getCovarianceMatrixType() 63 { 64 65 int retVal = getCovarianceMatrixType_0(nativeObj); 66 67 return retVal; 68 } 69 70 71 // 72 // C++: void setCovarianceMatrixType(int val) 73 // 74 75 //javadoc: EM::setCovarianceMatrixType(val) setCovarianceMatrixType(int val)76 public void setCovarianceMatrixType(int val) 77 { 78 79 setCovarianceMatrixType_0(nativeObj, val); 80 81 return; 82 } 83 84 85 // 86 // C++: TermCriteria getTermCriteria() 87 // 88 89 //javadoc: EM::getTermCriteria() getTermCriteria()90 public TermCriteria getTermCriteria() 91 { 92 93 TermCriteria retVal = new TermCriteria(getTermCriteria_0(nativeObj)); 94 95 return retVal; 96 } 97 98 99 // 100 // C++: void setTermCriteria(TermCriteria val) 101 // 102 103 //javadoc: EM::setTermCriteria(val) setTermCriteria(TermCriteria val)104 public void setTermCriteria(TermCriteria val) 105 { 106 107 setTermCriteria_0(nativeObj, val.type, val.maxCount, val.epsilon); 108 109 return; 110 } 111 112 113 // 114 // C++: Mat getWeights() 115 // 116 117 //javadoc: EM::getWeights() getWeights()118 public Mat getWeights() 119 { 120 121 Mat retVal = new Mat(getWeights_0(nativeObj)); 122 123 return retVal; 124 } 125 126 127 // 128 // C++: Mat getMeans() 129 // 130 131 //javadoc: EM::getMeans() getMeans()132 public Mat getMeans() 133 { 134 135 Mat retVal = new Mat(getMeans_0(nativeObj)); 136 137 return retVal; 138 } 139 140 141 // 142 // C++: Vec2d predict2(Mat sample, Mat& probs) 143 // 144 145 //javadoc: EM::predict2(sample, probs) predict2(Mat sample, Mat probs)146 public double[] predict2(Mat sample, Mat probs) 147 { 148 149 double[] retVal = predict2_0(nativeObj, sample.nativeObj, probs.nativeObj); 150 151 return retVal; 152 } 153 154 155 // 156 // C++: bool trainEM(Mat samples, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) 157 // 158 159 //javadoc: EM::trainEM(samples, logLikelihoods, labels, probs) trainEM(Mat samples, Mat logLikelihoods, Mat labels, Mat probs)160 public boolean trainEM(Mat samples, Mat logLikelihoods, Mat labels, Mat probs) 161 { 162 163 boolean retVal = trainEM_0(nativeObj, samples.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); 164 165 return retVal; 166 } 167 168 //javadoc: EM::trainEM(samples) trainEM(Mat samples)169 public boolean trainEM(Mat samples) 170 { 171 172 boolean retVal = trainEM_1(nativeObj, samples.nativeObj); 173 174 return retVal; 175 } 176 177 178 // 179 // C++: bool trainE(Mat samples, Mat means0, Mat covs0 = Mat(), Mat weights0 = Mat(), Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) 180 // 181 182 //javadoc: EM::trainE(samples, means0, covs0, weights0, logLikelihoods, labels, probs) trainE(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels, Mat probs)183 public boolean trainE(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels, Mat probs) 184 { 185 186 boolean retVal = trainE_0(nativeObj, samples.nativeObj, means0.nativeObj, covs0.nativeObj, weights0.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); 187 188 return retVal; 189 } 190 191 //javadoc: EM::trainE(samples, means0) trainE(Mat samples, Mat means0)192 public boolean trainE(Mat samples, Mat means0) 193 { 194 195 boolean retVal = trainE_1(nativeObj, samples.nativeObj, means0.nativeObj); 196 197 return retVal; 198 } 199 200 201 // 202 // C++: bool trainM(Mat samples, Mat probs0, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) 203 // 204 205 //javadoc: EM::trainM(samples, probs0, logLikelihoods, labels, probs) trainM(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels, Mat probs)206 public boolean trainM(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels, Mat probs) 207 { 208 209 boolean retVal = trainM_0(nativeObj, samples.nativeObj, probs0.nativeObj, logLikelihoods.nativeObj, labels.nativeObj, probs.nativeObj); 210 211 return retVal; 212 } 213 214 //javadoc: EM::trainM(samples, probs0) trainM(Mat samples, Mat probs0)215 public boolean trainM(Mat samples, Mat probs0) 216 { 217 218 boolean retVal = trainM_1(nativeObj, samples.nativeObj, probs0.nativeObj); 219 220 return retVal; 221 } 222 223 224 // 225 // C++: static Ptr_EM create() 226 // 227 228 //javadoc: EM::create() create()229 public static EM create() 230 { 231 232 EM retVal = new EM(create_0()); 233 234 return retVal; 235 } 236 237 238 @Override finalize()239 protected void finalize() throws Throwable { 240 delete(nativeObj); 241 } 242 243 244 245 // C++: int getClustersNumber() getClustersNumber_0(long nativeObj)246 private static native int getClustersNumber_0(long nativeObj); 247 248 // C++: void setClustersNumber(int val) setClustersNumber_0(long nativeObj, int val)249 private static native void setClustersNumber_0(long nativeObj, int val); 250 251 // C++: int getCovarianceMatrixType() getCovarianceMatrixType_0(long nativeObj)252 private static native int getCovarianceMatrixType_0(long nativeObj); 253 254 // C++: void setCovarianceMatrixType(int val) setCovarianceMatrixType_0(long nativeObj, int val)255 private static native void setCovarianceMatrixType_0(long nativeObj, int val); 256 257 // C++: TermCriteria getTermCriteria() getTermCriteria_0(long nativeObj)258 private static native double[] getTermCriteria_0(long nativeObj); 259 260 // C++: void setTermCriteria(TermCriteria val) setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon)261 private static native void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon); 262 263 // C++: Mat getWeights() getWeights_0(long nativeObj)264 private static native long getWeights_0(long nativeObj); 265 266 // C++: Mat getMeans() getMeans_0(long nativeObj)267 private static native long getMeans_0(long nativeObj); 268 269 // C++: Vec2d predict2(Mat sample, Mat& probs) predict2_0(long nativeObj, long sample_nativeObj, long probs_nativeObj)270 private static native double[] predict2_0(long nativeObj, long sample_nativeObj, long probs_nativeObj); 271 272 // C++: bool trainEM(Mat samples, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) trainEM_0(long nativeObj, long samples_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj)273 private static native boolean trainEM_0(long nativeObj, long samples_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); trainEM_1(long nativeObj, long samples_nativeObj)274 private static native boolean trainEM_1(long nativeObj, long samples_nativeObj); 275 276 // C++: bool trainE(Mat samples, Mat means0, Mat covs0 = Mat(), Mat weights0 = Mat(), Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) trainE_0(long nativeObj, long samples_nativeObj, long means0_nativeObj, long covs0_nativeObj, long weights0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj)277 private static native boolean trainE_0(long nativeObj, long samples_nativeObj, long means0_nativeObj, long covs0_nativeObj, long weights0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); trainE_1(long nativeObj, long samples_nativeObj, long means0_nativeObj)278 private static native boolean trainE_1(long nativeObj, long samples_nativeObj, long means0_nativeObj); 279 280 // C++: bool trainM(Mat samples, Mat probs0, Mat& logLikelihoods = Mat(), Mat& labels = Mat(), Mat& probs = Mat()) trainM_0(long nativeObj, long samples_nativeObj, long probs0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj)281 private static native boolean trainM_0(long nativeObj, long samples_nativeObj, long probs0_nativeObj, long logLikelihoods_nativeObj, long labels_nativeObj, long probs_nativeObj); trainM_1(long nativeObj, long samples_nativeObj, long probs0_nativeObj)282 private static native boolean trainM_1(long nativeObj, long samples_nativeObj, long probs0_nativeObj); 283 284 // C++: static Ptr_EM create() create_0()285 private static native long create_0(); 286 287 // native support for java finalize() delete(long nativeObj)288 private static native void delete(long nativeObj); 289 290 } 291