ANN_MLP.cs 24 KB

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