ANN_MLP.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.MlModule {
  8. // C++: class ANN_MLP
  9. //javadoc: ANN_MLP
  10. public class ANN_MLP : StatModel {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. ml_ANN_1MLP_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal ANN_MLP(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new ANN_MLP __fromPtr__(IntPtr addr) { return new ANN_MLP(addr); }
  31. // C++: enum TrainFlags
  32. public const int UPDATE_WEIGHTS = 1;
  33. public const int NO_INPUT_SCALE = 2;
  34. public const int NO_OUTPUT_SCALE = 4;
  35. // C++: enum TrainingMethods
  36. public const int BACKPROP = 0;
  37. public const int RPROP = 1;
  38. public const int ANNEAL = 2;
  39. // C++: enum ActivationFunctions
  40. public const int IDENTITY = 0;
  41. public const int SIGMOID_SYM = 1;
  42. public const int GAUSSIAN = 2;
  43. public const int RELU = 3;
  44. public const int LEAKYRELU = 4;
  45. //
  46. // C++: Mat cv::ml::ANN_MLP::getLayerSizes()
  47. //
  48. //javadoc: ANN_MLP::getLayerSizes()
  49. public Mat getLayerSizes() {
  50. ThrowIfDisposed();
  51. #if (UNITY_ANDROID && !UNITY_EDITOR)
  52. Mat retVal = new Mat(ml_ANN_1MLP_getLayerSizes_10(nativeObj));
  53. return retVal;
  54. #else
  55. return null;
  56. #endif
  57. }
  58. //
  59. // C++: Mat cv::ml::ANN_MLP::getWeights(int layerIdx)
  60. //
  61. //javadoc: ANN_MLP::getWeights(layerIdx)
  62. public Mat getWeights(int layerIdx) {
  63. ThrowIfDisposed();
  64. #if (UNITY_ANDROID && !UNITY_EDITOR)
  65. Mat retVal = new Mat(ml_ANN_1MLP_getWeights_10(nativeObj, layerIdx));
  66. return retVal;
  67. #else
  68. return null;
  69. #endif
  70. }
  71. //
  72. // C++: static Ptr_ANN_MLP cv::ml::ANN_MLP::create()
  73. //
  74. //javadoc: ANN_MLP::create()
  75. public static ANN_MLP create() {
  76. #if (UNITY_ANDROID && !UNITY_EDITOR)
  77. ANN_MLP retVal = ANN_MLP.__fromPtr__(ml_ANN_1MLP_create_10());
  78. return retVal;
  79. #else
  80. return null;
  81. #endif
  82. }
  83. //
  84. // C++: static Ptr_ANN_MLP cv::ml::ANN_MLP::load(String filepath)
  85. //
  86. //javadoc: ANN_MLP::load(filepath)
  87. public static ANN_MLP load(string filepath) {
  88. #if (UNITY_ANDROID && !UNITY_EDITOR)
  89. ANN_MLP retVal = ANN_MLP.__fromPtr__(ml_ANN_1MLP_load_10(filepath));
  90. return retVal;
  91. #else
  92. return null;
  93. #endif
  94. }
  95. //
  96. // C++: TermCriteria cv::ml::ANN_MLP::getTermCriteria()
  97. //
  98. //javadoc: ANN_MLP::getTermCriteria()
  99. public TermCriteria getTermCriteria() {
  100. ThrowIfDisposed();
  101. #if (UNITY_ANDROID && !UNITY_EDITOR)
  102. double[] tmpArray = new double[3];
  103. ml_ANN_1MLP_getTermCriteria_10(nativeObj, tmpArray);
  104. TermCriteria retVal = new TermCriteria(tmpArray);
  105. return retVal;
  106. #else
  107. return null;
  108. #endif
  109. }
  110. //
  111. // C++: double cv::ml::ANN_MLP::getAnnealCoolingRatio()
  112. //
  113. //javadoc: ANN_MLP::getAnnealCoolingRatio()
  114. public double getAnnealCoolingRatio() {
  115. ThrowIfDisposed();
  116. #if (UNITY_ANDROID && !UNITY_EDITOR)
  117. double retVal = ml_ANN_1MLP_getAnnealCoolingRatio_10(nativeObj);
  118. return retVal;
  119. #else
  120. return -1;
  121. #endif
  122. }
  123. //
  124. // C++: double cv::ml::ANN_MLP::getAnnealFinalT()
  125. //
  126. //javadoc: ANN_MLP::getAnnealFinalT()
  127. public double getAnnealFinalT() {
  128. ThrowIfDisposed();
  129. #if (UNITY_ANDROID && !UNITY_EDITOR)
  130. double retVal = ml_ANN_1MLP_getAnnealFinalT_10(nativeObj);
  131. return retVal;
  132. #else
  133. return -1;
  134. #endif
  135. }
  136. //
  137. // C++: double cv::ml::ANN_MLP::getAnnealInitialT()
  138. //
  139. //javadoc: ANN_MLP::getAnnealInitialT()
  140. public double getAnnealInitialT() {
  141. ThrowIfDisposed();
  142. #if (UNITY_ANDROID && !UNITY_EDITOR)
  143. double retVal = ml_ANN_1MLP_getAnnealInitialT_10(nativeObj);
  144. return retVal;
  145. #else
  146. return -1;
  147. #endif
  148. }
  149. //
  150. // C++: double cv::ml::ANN_MLP::getBackpropMomentumScale()
  151. //
  152. //javadoc: ANN_MLP::getBackpropMomentumScale()
  153. public double getBackpropMomentumScale() {
  154. ThrowIfDisposed();
  155. #if (UNITY_ANDROID && !UNITY_EDITOR)
  156. double retVal = ml_ANN_1MLP_getBackpropMomentumScale_10(nativeObj);
  157. return retVal;
  158. #else
  159. return -1;
  160. #endif
  161. }
  162. //
  163. // C++: double cv::ml::ANN_MLP::getBackpropWeightScale()
  164. //
  165. //javadoc: ANN_MLP::getBackpropWeightScale()
  166. public double getBackpropWeightScale() {
  167. ThrowIfDisposed();
  168. #if (UNITY_ANDROID && !UNITY_EDITOR)
  169. double retVal = ml_ANN_1MLP_getBackpropWeightScale_10(nativeObj);
  170. return retVal;
  171. #else
  172. return -1;
  173. #endif
  174. }
  175. //
  176. // C++: double cv::ml::ANN_MLP::getRpropDW0()
  177. //
  178. //javadoc: ANN_MLP::getRpropDW0()
  179. public double getRpropDW0() {
  180. ThrowIfDisposed();
  181. #if (UNITY_ANDROID && !UNITY_EDITOR)
  182. double retVal = ml_ANN_1MLP_getRpropDW0_10(nativeObj);
  183. return retVal;
  184. #else
  185. return -1;
  186. #endif
  187. }
  188. //
  189. // C++: double cv::ml::ANN_MLP::getRpropDWMax()
  190. //
  191. //javadoc: ANN_MLP::getRpropDWMax()
  192. public double getRpropDWMax() {
  193. ThrowIfDisposed();
  194. #if (UNITY_ANDROID && !UNITY_EDITOR)
  195. double retVal = ml_ANN_1MLP_getRpropDWMax_10(nativeObj);
  196. return retVal;
  197. #else
  198. return -1;
  199. #endif
  200. }
  201. //
  202. // C++: double cv::ml::ANN_MLP::getRpropDWMin()
  203. //
  204. //javadoc: ANN_MLP::getRpropDWMin()
  205. public double getRpropDWMin() {
  206. ThrowIfDisposed();
  207. #if (UNITY_ANDROID && !UNITY_EDITOR)
  208. double retVal = ml_ANN_1MLP_getRpropDWMin_10(nativeObj);
  209. return retVal;
  210. #else
  211. return -1;
  212. #endif
  213. }
  214. //
  215. // C++: double cv::ml::ANN_MLP::getRpropDWMinus()
  216. //
  217. //javadoc: ANN_MLP::getRpropDWMinus()
  218. public double getRpropDWMinus() {
  219. ThrowIfDisposed();
  220. #if (UNITY_ANDROID && !UNITY_EDITOR)
  221. double retVal = ml_ANN_1MLP_getRpropDWMinus_10(nativeObj);
  222. return retVal;
  223. #else
  224. return -1;
  225. #endif
  226. }
  227. //
  228. // C++: double cv::ml::ANN_MLP::getRpropDWPlus()
  229. //
  230. //javadoc: ANN_MLP::getRpropDWPlus()
  231. public double getRpropDWPlus() {
  232. ThrowIfDisposed();
  233. #if (UNITY_ANDROID && !UNITY_EDITOR)
  234. double retVal = ml_ANN_1MLP_getRpropDWPlus_10(nativeObj);
  235. return retVal;
  236. #else
  237. return -1;
  238. #endif
  239. }
  240. //
  241. // C++: int cv::ml::ANN_MLP::getAnnealItePerStep()
  242. //
  243. //javadoc: ANN_MLP::getAnnealItePerStep()
  244. public int getAnnealItePerStep() {
  245. ThrowIfDisposed();
  246. #if (UNITY_ANDROID && !UNITY_EDITOR)
  247. int retVal = ml_ANN_1MLP_getAnnealItePerStep_10(nativeObj);
  248. return retVal;
  249. #else
  250. return -1;
  251. #endif
  252. }
  253. //
  254. // C++: int cv::ml::ANN_MLP::getTrainMethod()
  255. //
  256. //javadoc: ANN_MLP::getTrainMethod()
  257. public int getTrainMethod() {
  258. ThrowIfDisposed();
  259. #if (UNITY_ANDROID && !UNITY_EDITOR)
  260. int retVal = ml_ANN_1MLP_getTrainMethod_10(nativeObj);
  261. return retVal;
  262. #else
  263. return -1;
  264. #endif
  265. }
  266. //
  267. // C++: void cv::ml::ANN_MLP::setActivationFunction(int type, double param1 = 0, double param2 = 0)
  268. //
  269. //javadoc: ANN_MLP::setActivationFunction(type, param1, param2)
  270. public void setActivationFunction(int type, double param1, double param2) {
  271. ThrowIfDisposed();
  272. #if (UNITY_ANDROID && !UNITY_EDITOR)
  273. ml_ANN_1MLP_setActivationFunction_10(nativeObj, type, param1, param2);
  274. return;
  275. #else
  276. return;
  277. #endif
  278. }
  279. //javadoc: ANN_MLP::setActivationFunction(type, param1)
  280. public void setActivationFunction(int type, double param1) {
  281. ThrowIfDisposed();
  282. #if (UNITY_ANDROID && !UNITY_EDITOR)
  283. ml_ANN_1MLP_setActivationFunction_11(nativeObj, type, param1);
  284. return;
  285. #else
  286. return;
  287. #endif
  288. }
  289. //javadoc: ANN_MLP::setActivationFunction(type)
  290. public void setActivationFunction(int type) {
  291. ThrowIfDisposed();
  292. #if (UNITY_ANDROID && !UNITY_EDITOR)
  293. ml_ANN_1MLP_setActivationFunction_12(nativeObj, type);
  294. return;
  295. #else
  296. return;
  297. #endif
  298. }
  299. //
  300. // C++: void cv::ml::ANN_MLP::setAnnealCoolingRatio(double val)
  301. //
  302. //javadoc: ANN_MLP::setAnnealCoolingRatio(val)
  303. public void setAnnealCoolingRatio(double val) {
  304. ThrowIfDisposed();
  305. #if (UNITY_ANDROID && !UNITY_EDITOR)
  306. ml_ANN_1MLP_setAnnealCoolingRatio_10(nativeObj, val);
  307. return;
  308. #else
  309. return;
  310. #endif
  311. }
  312. //
  313. // C++: void cv::ml::ANN_MLP::setAnnealFinalT(double val)
  314. //
  315. //javadoc: ANN_MLP::setAnnealFinalT(val)
  316. public void setAnnealFinalT(double val) {
  317. ThrowIfDisposed();
  318. #if (UNITY_ANDROID && !UNITY_EDITOR)
  319. ml_ANN_1MLP_setAnnealFinalT_10(nativeObj, val);
  320. return;
  321. #else
  322. return;
  323. #endif
  324. }
  325. //
  326. // C++: void cv::ml::ANN_MLP::setAnnealInitialT(double val)
  327. //
  328. //javadoc: ANN_MLP::setAnnealInitialT(val)
  329. public void setAnnealInitialT(double val) {
  330. ThrowIfDisposed();
  331. #if (UNITY_ANDROID && !UNITY_EDITOR)
  332. ml_ANN_1MLP_setAnnealInitialT_10(nativeObj, val);
  333. return;
  334. #else
  335. return;
  336. #endif
  337. }
  338. //
  339. // C++: void cv::ml::ANN_MLP::setAnnealItePerStep(int val)
  340. //
  341. //javadoc: ANN_MLP::setAnnealItePerStep(val)
  342. public void setAnnealItePerStep(int val) {
  343. ThrowIfDisposed();
  344. #if (UNITY_ANDROID && !UNITY_EDITOR)
  345. ml_ANN_1MLP_setAnnealItePerStep_10(nativeObj, val);
  346. return;
  347. #else
  348. return;
  349. #endif
  350. }
  351. //
  352. // C++: void cv::ml::ANN_MLP::setBackpropMomentumScale(double val)
  353. //
  354. //javadoc: ANN_MLP::setBackpropMomentumScale(val)
  355. public void setBackpropMomentumScale(double val) {
  356. ThrowIfDisposed();
  357. #if (UNITY_ANDROID && !UNITY_EDITOR)
  358. ml_ANN_1MLP_setBackpropMomentumScale_10(nativeObj, val);
  359. return;
  360. #else
  361. return;
  362. #endif
  363. }
  364. //
  365. // C++: void cv::ml::ANN_MLP::setBackpropWeightScale(double val)
  366. //
  367. //javadoc: ANN_MLP::setBackpropWeightScale(val)
  368. public void setBackpropWeightScale(double val) {
  369. ThrowIfDisposed();
  370. #if (UNITY_ANDROID && !UNITY_EDITOR)
  371. ml_ANN_1MLP_setBackpropWeightScale_10(nativeObj, val);
  372. return;
  373. #else
  374. return;
  375. #endif
  376. }
  377. //
  378. // C++: void cv::ml::ANN_MLP::setLayerSizes(Mat _layer_sizes)
  379. //
  380. //javadoc: ANN_MLP::setLayerSizes(_layer_sizes)
  381. public void setLayerSizes(Mat _layer_sizes) {
  382. ThrowIfDisposed();
  383. if (_layer_sizes != null) _layer_sizes.ThrowIfDisposed();
  384. #if (UNITY_ANDROID && !UNITY_EDITOR)
  385. ml_ANN_1MLP_setLayerSizes_10(nativeObj, _layer_sizes.nativeObj);
  386. return;
  387. #else
  388. return;
  389. #endif
  390. }
  391. //
  392. // C++: void cv::ml::ANN_MLP::setRpropDW0(double val)
  393. //
  394. //javadoc: ANN_MLP::setRpropDW0(val)
  395. public void setRpropDW0(double val) {
  396. ThrowIfDisposed();
  397. #if (UNITY_ANDROID && !UNITY_EDITOR)
  398. ml_ANN_1MLP_setRpropDW0_10(nativeObj, val);
  399. return;
  400. #else
  401. return;
  402. #endif
  403. }
  404. //
  405. // C++: void cv::ml::ANN_MLP::setRpropDWMax(double val)
  406. //
  407. //javadoc: ANN_MLP::setRpropDWMax(val)
  408. public void setRpropDWMax(double val) {
  409. ThrowIfDisposed();
  410. #if (UNITY_ANDROID && !UNITY_EDITOR)
  411. ml_ANN_1MLP_setRpropDWMax_10(nativeObj, val);
  412. return;
  413. #else
  414. return;
  415. #endif
  416. }
  417. //
  418. // C++: void cv::ml::ANN_MLP::setRpropDWMin(double val)
  419. //
  420. //javadoc: ANN_MLP::setRpropDWMin(val)
  421. public void setRpropDWMin(double val) {
  422. ThrowIfDisposed();
  423. #if (UNITY_ANDROID && !UNITY_EDITOR)
  424. ml_ANN_1MLP_setRpropDWMin_10(nativeObj, val);
  425. return;
  426. #else
  427. return;
  428. #endif
  429. }
  430. //
  431. // C++: void cv::ml::ANN_MLP::setRpropDWMinus(double val)
  432. //
  433. //javadoc: ANN_MLP::setRpropDWMinus(val)
  434. public void setRpropDWMinus(double val) {
  435. ThrowIfDisposed();
  436. #if (UNITY_ANDROID && !UNITY_EDITOR)
  437. ml_ANN_1MLP_setRpropDWMinus_10(nativeObj, val);
  438. return;
  439. #else
  440. return;
  441. #endif
  442. }
  443. //
  444. // C++: void cv::ml::ANN_MLP::setRpropDWPlus(double val)
  445. //
  446. //javadoc: ANN_MLP::setRpropDWPlus(val)
  447. public void setRpropDWPlus(double val) {
  448. ThrowIfDisposed();
  449. #if (UNITY_ANDROID && !UNITY_EDITOR)
  450. ml_ANN_1MLP_setRpropDWPlus_10(nativeObj, val);
  451. return;
  452. #else
  453. return;
  454. #endif
  455. }
  456. //
  457. // C++: void cv::ml::ANN_MLP::setTermCriteria(TermCriteria val)
  458. //
  459. //javadoc: ANN_MLP::setTermCriteria(val)
  460. public void setTermCriteria(TermCriteria val) {
  461. ThrowIfDisposed();
  462. #if (UNITY_ANDROID && !UNITY_EDITOR)
  463. ml_ANN_1MLP_setTermCriteria_10(nativeObj, val.type, val.maxCount, val.epsilon);
  464. return;
  465. #else
  466. return;
  467. #endif
  468. }
  469. //
  470. // C++: void cv::ml::ANN_MLP::setTrainMethod(int method, double param1 = 0, double param2 = 0)
  471. //
  472. //javadoc: ANN_MLP::setTrainMethod(method, param1, param2)
  473. public void setTrainMethod(int method, double param1, double param2) {
  474. ThrowIfDisposed();
  475. #if (UNITY_ANDROID && !UNITY_EDITOR)
  476. ml_ANN_1MLP_setTrainMethod_10(nativeObj, method, param1, param2);
  477. return;
  478. #else
  479. return;
  480. #endif
  481. }
  482. //javadoc: ANN_MLP::setTrainMethod(method, param1)
  483. public void setTrainMethod(int method, double param1) {
  484. ThrowIfDisposed();
  485. #if (UNITY_ANDROID && !UNITY_EDITOR)
  486. ml_ANN_1MLP_setTrainMethod_11(nativeObj, method, param1);
  487. return;
  488. #else
  489. return;
  490. #endif
  491. }
  492. //javadoc: ANN_MLP::setTrainMethod(method)
  493. public void setTrainMethod(int method) {
  494. ThrowIfDisposed();
  495. #if (UNITY_ANDROID && !UNITY_EDITOR)
  496. ml_ANN_1MLP_setTrainMethod_12(nativeObj, method);
  497. return;
  498. #else
  499. return;
  500. #endif
  501. }
  502. #if (UNITY_ANDROID && !UNITY_EDITOR)
  503. const string LIBNAME = "opencvforunity";
  504. // C++: Mat cv::ml::ANN_MLP::getLayerSizes()
  505. [DllImport(LIBNAME)]
  506. private static extern IntPtr ml_ANN_1MLP_getLayerSizes_10(IntPtr nativeObj);
  507. // C++: Mat cv::ml::ANN_MLP::getWeights(int layerIdx)
  508. [DllImport(LIBNAME)]
  509. private static extern IntPtr ml_ANN_1MLP_getWeights_10(IntPtr nativeObj, int layerIdx);
  510. // C++: static Ptr_ANN_MLP cv::ml::ANN_MLP::create()
  511. [DllImport(LIBNAME)]
  512. private static extern IntPtr ml_ANN_1MLP_create_10();
  513. // C++: static Ptr_ANN_MLP cv::ml::ANN_MLP::load(String filepath)
  514. [DllImport(LIBNAME)]
  515. private static extern IntPtr ml_ANN_1MLP_load_10(string filepath);
  516. // C++: TermCriteria cv::ml::ANN_MLP::getTermCriteria()
  517. [DllImport(LIBNAME)]
  518. private static extern void ml_ANN_1MLP_getTermCriteria_10(IntPtr nativeObj, double[] retVal);
  519. // C++: double cv::ml::ANN_MLP::getAnnealCoolingRatio()
  520. [DllImport(LIBNAME)]
  521. private static extern double ml_ANN_1MLP_getAnnealCoolingRatio_10(IntPtr nativeObj);
  522. // C++: double cv::ml::ANN_MLP::getAnnealFinalT()
  523. [DllImport(LIBNAME)]
  524. private static extern double ml_ANN_1MLP_getAnnealFinalT_10(IntPtr nativeObj);
  525. // C++: double cv::ml::ANN_MLP::getAnnealInitialT()
  526. [DllImport(LIBNAME)]
  527. private static extern double ml_ANN_1MLP_getAnnealInitialT_10(IntPtr nativeObj);
  528. // C++: double cv::ml::ANN_MLP::getBackpropMomentumScale()
  529. [DllImport(LIBNAME)]
  530. private static extern double ml_ANN_1MLP_getBackpropMomentumScale_10(IntPtr nativeObj);
  531. // C++: double cv::ml::ANN_MLP::getBackpropWeightScale()
  532. [DllImport(LIBNAME)]
  533. private static extern double ml_ANN_1MLP_getBackpropWeightScale_10(IntPtr nativeObj);
  534. // C++: double cv::ml::ANN_MLP::getRpropDW0()
  535. [DllImport(LIBNAME)]
  536. private static extern double ml_ANN_1MLP_getRpropDW0_10(IntPtr nativeObj);
  537. // C++: double cv::ml::ANN_MLP::getRpropDWMax()
  538. [DllImport(LIBNAME)]
  539. private static extern double ml_ANN_1MLP_getRpropDWMax_10(IntPtr nativeObj);
  540. // C++: double cv::ml::ANN_MLP::getRpropDWMin()
  541. [DllImport(LIBNAME)]
  542. private static extern double ml_ANN_1MLP_getRpropDWMin_10(IntPtr nativeObj);
  543. // C++: double cv::ml::ANN_MLP::getRpropDWMinus()
  544. [DllImport(LIBNAME)]
  545. private static extern double ml_ANN_1MLP_getRpropDWMinus_10(IntPtr nativeObj);
  546. // C++: double cv::ml::ANN_MLP::getRpropDWPlus()
  547. [DllImport(LIBNAME)]
  548. private static extern double ml_ANN_1MLP_getRpropDWPlus_10(IntPtr nativeObj);
  549. // C++: int cv::ml::ANN_MLP::getAnnealItePerStep()
  550. [DllImport(LIBNAME)]
  551. private static extern int ml_ANN_1MLP_getAnnealItePerStep_10(IntPtr nativeObj);
  552. // C++: int cv::ml::ANN_MLP::getTrainMethod()
  553. [DllImport(LIBNAME)]
  554. private static extern int ml_ANN_1MLP_getTrainMethod_10(IntPtr nativeObj);
  555. // C++: void cv::ml::ANN_MLP::setActivationFunction(int type, double param1 = 0, double param2 = 0)
  556. [DllImport(LIBNAME)]
  557. private static extern void ml_ANN_1MLP_setActivationFunction_10(IntPtr nativeObj, int type, double param1, double param2);
  558. [DllImport(LIBNAME)]
  559. private static extern void ml_ANN_1MLP_setActivationFunction_11(IntPtr nativeObj, int type, double param1);
  560. [DllImport(LIBNAME)]
  561. private static extern void ml_ANN_1MLP_setActivationFunction_12(IntPtr nativeObj, int type);
  562. // C++: void cv::ml::ANN_MLP::setAnnealCoolingRatio(double val)
  563. [DllImport(LIBNAME)]
  564. private static extern void ml_ANN_1MLP_setAnnealCoolingRatio_10(IntPtr nativeObj, double val);
  565. // C++: void cv::ml::ANN_MLP::setAnnealFinalT(double val)
  566. [DllImport(LIBNAME)]
  567. private static extern void ml_ANN_1MLP_setAnnealFinalT_10(IntPtr nativeObj, double val);
  568. // C++: void cv::ml::ANN_MLP::setAnnealInitialT(double val)
  569. [DllImport(LIBNAME)]
  570. private static extern void ml_ANN_1MLP_setAnnealInitialT_10(IntPtr nativeObj, double val);
  571. // C++: void cv::ml::ANN_MLP::setAnnealItePerStep(int val)
  572. [DllImport(LIBNAME)]
  573. private static extern void ml_ANN_1MLP_setAnnealItePerStep_10(IntPtr nativeObj, int val);
  574. // C++: void cv::ml::ANN_MLP::setBackpropMomentumScale(double val)
  575. [DllImport(LIBNAME)]
  576. private static extern void ml_ANN_1MLP_setBackpropMomentumScale_10(IntPtr nativeObj, double val);
  577. // C++: void cv::ml::ANN_MLP::setBackpropWeightScale(double val)
  578. [DllImport(LIBNAME)]
  579. private static extern void ml_ANN_1MLP_setBackpropWeightScale_10(IntPtr nativeObj, double val);
  580. // C++: void cv::ml::ANN_MLP::setLayerSizes(Mat _layer_sizes)
  581. [DllImport(LIBNAME)]
  582. private static extern void ml_ANN_1MLP_setLayerSizes_10(IntPtr nativeObj, IntPtr _layer_sizes_nativeObj);
  583. // C++: void cv::ml::ANN_MLP::setRpropDW0(double val)
  584. [DllImport(LIBNAME)]
  585. private static extern void ml_ANN_1MLP_setRpropDW0_10(IntPtr nativeObj, double val);
  586. // C++: void cv::ml::ANN_MLP::setRpropDWMax(double val)
  587. [DllImport(LIBNAME)]
  588. private static extern void ml_ANN_1MLP_setRpropDWMax_10(IntPtr nativeObj, double val);
  589. // C++: void cv::ml::ANN_MLP::setRpropDWMin(double val)
  590. [DllImport(LIBNAME)]
  591. private static extern void ml_ANN_1MLP_setRpropDWMin_10(IntPtr nativeObj, double val);
  592. // C++: void cv::ml::ANN_MLP::setRpropDWMinus(double val)
  593. [DllImport(LIBNAME)]
  594. private static extern void ml_ANN_1MLP_setRpropDWMinus_10(IntPtr nativeObj, double val);
  595. // C++: void cv::ml::ANN_MLP::setRpropDWPlus(double val)
  596. [DllImport(LIBNAME)]
  597. private static extern void ml_ANN_1MLP_setRpropDWPlus_10(IntPtr nativeObj, double val);
  598. // C++: void cv::ml::ANN_MLP::setTermCriteria(TermCriteria val)
  599. [DllImport(LIBNAME)]
  600. private static extern void ml_ANN_1MLP_setTermCriteria_10(IntPtr nativeObj, int val_type, int val_maxCount, double val_epsilon);
  601. // C++: void cv::ml::ANN_MLP::setTrainMethod(int method, double param1 = 0, double param2 = 0)
  602. [DllImport(LIBNAME)]
  603. private static extern void ml_ANN_1MLP_setTrainMethod_10(IntPtr nativeObj, int method, double param1, double param2);
  604. [DllImport(LIBNAME)]
  605. private static extern void ml_ANN_1MLP_setTrainMethod_11(IntPtr nativeObj, int method, double param1);
  606. [DllImport(LIBNAME)]
  607. private static extern void ml_ANN_1MLP_setTrainMethod_12(IntPtr nativeObj, int method);
  608. // native support for java finalize()
  609. [DllImport(LIBNAME)]
  610. private static extern void ml_ANN_1MLP_delete(IntPtr nativeObj);
  611. #endif
  612. }
  613. }