BackgroundSubtractorGMG.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.VideoModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.BgsegmModule
  9. {
  10. // C++: class BackgroundSubtractorGMG
  11. //javadoc: BackgroundSubtractorGMG
  12. public class BackgroundSubtractorGMG : BackgroundSubtractor
  13. {
  14. protected override void Dispose (bool disposing)
  15. {
  16. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  17. try {
  18. if (disposing) {
  19. }
  20. if (IsEnabledDispose) {
  21. if (nativeObj != IntPtr.Zero)
  22. bgsegm_BackgroundSubtractorGMG_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal BackgroundSubtractorGMG (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new BackgroundSubtractorGMG __fromPtr__ (IntPtr addr) { return new BackgroundSubtractorGMG (addr); }
  35. //
  36. // C++: bool cv::bgsegm::BackgroundSubtractorGMG::getUpdateBackgroundModel()
  37. //
  38. //javadoc: BackgroundSubtractorGMG::getUpdateBackgroundModel()
  39. public bool getUpdateBackgroundModel ()
  40. {
  41. ThrowIfDisposed ();
  42. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  43. bool retVal = bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel_10(nativeObj);
  44. return retVal;
  45. #else
  46. return false;
  47. #endif
  48. }
  49. //
  50. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getBackgroundPrior()
  51. //
  52. //javadoc: BackgroundSubtractorGMG::getBackgroundPrior()
  53. public double getBackgroundPrior ()
  54. {
  55. ThrowIfDisposed ();
  56. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  57. double retVal = bgsegm_BackgroundSubtractorGMG_getBackgroundPrior_10(nativeObj);
  58. return retVal;
  59. #else
  60. return -1;
  61. #endif
  62. }
  63. //
  64. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getDecisionThreshold()
  65. //
  66. //javadoc: BackgroundSubtractorGMG::getDecisionThreshold()
  67. public double getDecisionThreshold ()
  68. {
  69. ThrowIfDisposed ();
  70. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  71. double retVal = bgsegm_BackgroundSubtractorGMG_getDecisionThreshold_10(nativeObj);
  72. return retVal;
  73. #else
  74. return -1;
  75. #endif
  76. }
  77. //
  78. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getDefaultLearningRate()
  79. //
  80. //javadoc: BackgroundSubtractorGMG::getDefaultLearningRate()
  81. public double getDefaultLearningRate ()
  82. {
  83. ThrowIfDisposed ();
  84. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  85. double retVal = bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate_10(nativeObj);
  86. return retVal;
  87. #else
  88. return -1;
  89. #endif
  90. }
  91. //
  92. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getMaxVal()
  93. //
  94. //javadoc: BackgroundSubtractorGMG::getMaxVal()
  95. public double getMaxVal ()
  96. {
  97. ThrowIfDisposed ();
  98. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  99. double retVal = bgsegm_BackgroundSubtractorGMG_getMaxVal_10(nativeObj);
  100. return retVal;
  101. #else
  102. return -1;
  103. #endif
  104. }
  105. //
  106. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getMinVal()
  107. //
  108. //javadoc: BackgroundSubtractorGMG::getMinVal()
  109. public double getMinVal ()
  110. {
  111. ThrowIfDisposed ();
  112. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  113. double retVal = bgsegm_BackgroundSubtractorGMG_getMinVal_10(nativeObj);
  114. return retVal;
  115. #else
  116. return -1;
  117. #endif
  118. }
  119. //
  120. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getMaxFeatures()
  121. //
  122. //javadoc: BackgroundSubtractorGMG::getMaxFeatures()
  123. public int getMaxFeatures ()
  124. {
  125. ThrowIfDisposed ();
  126. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  127. int retVal = bgsegm_BackgroundSubtractorGMG_getMaxFeatures_10(nativeObj);
  128. return retVal;
  129. #else
  130. return -1;
  131. #endif
  132. }
  133. //
  134. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getNumFrames()
  135. //
  136. //javadoc: BackgroundSubtractorGMG::getNumFrames()
  137. public int getNumFrames ()
  138. {
  139. ThrowIfDisposed ();
  140. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  141. int retVal = bgsegm_BackgroundSubtractorGMG_getNumFrames_10(nativeObj);
  142. return retVal;
  143. #else
  144. return -1;
  145. #endif
  146. }
  147. //
  148. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getQuantizationLevels()
  149. //
  150. //javadoc: BackgroundSubtractorGMG::getQuantizationLevels()
  151. public int getQuantizationLevels ()
  152. {
  153. ThrowIfDisposed ();
  154. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  155. int retVal = bgsegm_BackgroundSubtractorGMG_getQuantizationLevels_10(nativeObj);
  156. return retVal;
  157. #else
  158. return -1;
  159. #endif
  160. }
  161. //
  162. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getSmoothingRadius()
  163. //
  164. //javadoc: BackgroundSubtractorGMG::getSmoothingRadius()
  165. public int getSmoothingRadius ()
  166. {
  167. ThrowIfDisposed ();
  168. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  169. int retVal = bgsegm_BackgroundSubtractorGMG_getSmoothingRadius_10(nativeObj);
  170. return retVal;
  171. #else
  172. return -1;
  173. #endif
  174. }
  175. //
  176. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setBackgroundPrior(double bgprior)
  177. //
  178. //javadoc: BackgroundSubtractorGMG::setBackgroundPrior(bgprior)
  179. public void setBackgroundPrior (double bgprior)
  180. {
  181. ThrowIfDisposed ();
  182. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  183. bgsegm_BackgroundSubtractorGMG_setBackgroundPrior_10(nativeObj, bgprior);
  184. return;
  185. #else
  186. return;
  187. #endif
  188. }
  189. //
  190. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setDecisionThreshold(double thresh)
  191. //
  192. //javadoc: BackgroundSubtractorGMG::setDecisionThreshold(thresh)
  193. public void setDecisionThreshold (double thresh)
  194. {
  195. ThrowIfDisposed ();
  196. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  197. bgsegm_BackgroundSubtractorGMG_setDecisionThreshold_10(nativeObj, thresh);
  198. return;
  199. #else
  200. return;
  201. #endif
  202. }
  203. //
  204. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setDefaultLearningRate(double lr)
  205. //
  206. //javadoc: BackgroundSubtractorGMG::setDefaultLearningRate(lr)
  207. public void setDefaultLearningRate (double lr)
  208. {
  209. ThrowIfDisposed ();
  210. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  211. bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate_10(nativeObj, lr);
  212. return;
  213. #else
  214. return;
  215. #endif
  216. }
  217. //
  218. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxFeatures(int maxFeatures)
  219. //
  220. //javadoc: BackgroundSubtractorGMG::setMaxFeatures(maxFeatures)
  221. public void setMaxFeatures (int maxFeatures)
  222. {
  223. ThrowIfDisposed ();
  224. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  225. bgsegm_BackgroundSubtractorGMG_setMaxFeatures_10(nativeObj, maxFeatures);
  226. return;
  227. #else
  228. return;
  229. #endif
  230. }
  231. //
  232. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxVal(double val)
  233. //
  234. //javadoc: BackgroundSubtractorGMG::setMaxVal(val)
  235. public void setMaxVal (double val)
  236. {
  237. ThrowIfDisposed ();
  238. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  239. bgsegm_BackgroundSubtractorGMG_setMaxVal_10(nativeObj, val);
  240. return;
  241. #else
  242. return;
  243. #endif
  244. }
  245. //
  246. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMinVal(double val)
  247. //
  248. //javadoc: BackgroundSubtractorGMG::setMinVal(val)
  249. public void setMinVal (double val)
  250. {
  251. ThrowIfDisposed ();
  252. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  253. bgsegm_BackgroundSubtractorGMG_setMinVal_10(nativeObj, val);
  254. return;
  255. #else
  256. return;
  257. #endif
  258. }
  259. //
  260. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setNumFrames(int nframes)
  261. //
  262. //javadoc: BackgroundSubtractorGMG::setNumFrames(nframes)
  263. public void setNumFrames (int nframes)
  264. {
  265. ThrowIfDisposed ();
  266. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  267. bgsegm_BackgroundSubtractorGMG_setNumFrames_10(nativeObj, nframes);
  268. return;
  269. #else
  270. return;
  271. #endif
  272. }
  273. //
  274. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setQuantizationLevels(int nlevels)
  275. //
  276. //javadoc: BackgroundSubtractorGMG::setQuantizationLevels(nlevels)
  277. public void setQuantizationLevels (int nlevels)
  278. {
  279. ThrowIfDisposed ();
  280. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  281. bgsegm_BackgroundSubtractorGMG_setQuantizationLevels_10(nativeObj, nlevels);
  282. return;
  283. #else
  284. return;
  285. #endif
  286. }
  287. //
  288. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setSmoothingRadius(int radius)
  289. //
  290. //javadoc: BackgroundSubtractorGMG::setSmoothingRadius(radius)
  291. public void setSmoothingRadius (int radius)
  292. {
  293. ThrowIfDisposed ();
  294. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  295. bgsegm_BackgroundSubtractorGMG_setSmoothingRadius_10(nativeObj, radius);
  296. return;
  297. #else
  298. return;
  299. #endif
  300. }
  301. //
  302. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setUpdateBackgroundModel(bool update)
  303. //
  304. //javadoc: BackgroundSubtractorGMG::setUpdateBackgroundModel(update)
  305. public void setUpdateBackgroundModel (bool update)
  306. {
  307. ThrowIfDisposed ();
  308. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  309. bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel_10(nativeObj, update);
  310. return;
  311. #else
  312. return;
  313. #endif
  314. }
  315. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  316. const string LIBNAME = "__Internal";
  317. #else
  318. const string LIBNAME = "opencvforunity";
  319. #endif
  320. // C++: bool cv::bgsegm::BackgroundSubtractorGMG::getUpdateBackgroundModel()
  321. [DllImport (LIBNAME)]
  322. private static extern bool bgsegm_BackgroundSubtractorGMG_getUpdateBackgroundModel_10 (IntPtr nativeObj);
  323. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getBackgroundPrior()
  324. [DllImport (LIBNAME)]
  325. private static extern double bgsegm_BackgroundSubtractorGMG_getBackgroundPrior_10 (IntPtr nativeObj);
  326. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getDecisionThreshold()
  327. [DllImport (LIBNAME)]
  328. private static extern double bgsegm_BackgroundSubtractorGMG_getDecisionThreshold_10 (IntPtr nativeObj);
  329. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getDefaultLearningRate()
  330. [DllImport (LIBNAME)]
  331. private static extern double bgsegm_BackgroundSubtractorGMG_getDefaultLearningRate_10 (IntPtr nativeObj);
  332. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getMaxVal()
  333. [DllImport (LIBNAME)]
  334. private static extern double bgsegm_BackgroundSubtractorGMG_getMaxVal_10 (IntPtr nativeObj);
  335. // C++: double cv::bgsegm::BackgroundSubtractorGMG::getMinVal()
  336. [DllImport (LIBNAME)]
  337. private static extern double bgsegm_BackgroundSubtractorGMG_getMinVal_10 (IntPtr nativeObj);
  338. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getMaxFeatures()
  339. [DllImport (LIBNAME)]
  340. private static extern int bgsegm_BackgroundSubtractorGMG_getMaxFeatures_10 (IntPtr nativeObj);
  341. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getNumFrames()
  342. [DllImport (LIBNAME)]
  343. private static extern int bgsegm_BackgroundSubtractorGMG_getNumFrames_10 (IntPtr nativeObj);
  344. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getQuantizationLevels()
  345. [DllImport (LIBNAME)]
  346. private static extern int bgsegm_BackgroundSubtractorGMG_getQuantizationLevels_10 (IntPtr nativeObj);
  347. // C++: int cv::bgsegm::BackgroundSubtractorGMG::getSmoothingRadius()
  348. [DllImport (LIBNAME)]
  349. private static extern int bgsegm_BackgroundSubtractorGMG_getSmoothingRadius_10 (IntPtr nativeObj);
  350. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setBackgroundPrior(double bgprior)
  351. [DllImport (LIBNAME)]
  352. private static extern void bgsegm_BackgroundSubtractorGMG_setBackgroundPrior_10 (IntPtr nativeObj, double bgprior);
  353. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setDecisionThreshold(double thresh)
  354. [DllImport (LIBNAME)]
  355. private static extern void bgsegm_BackgroundSubtractorGMG_setDecisionThreshold_10 (IntPtr nativeObj, double thresh);
  356. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setDefaultLearningRate(double lr)
  357. [DllImport (LIBNAME)]
  358. private static extern void bgsegm_BackgroundSubtractorGMG_setDefaultLearningRate_10 (IntPtr nativeObj, double lr);
  359. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxFeatures(int maxFeatures)
  360. [DllImport (LIBNAME)]
  361. private static extern void bgsegm_BackgroundSubtractorGMG_setMaxFeatures_10 (IntPtr nativeObj, int maxFeatures);
  362. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMaxVal(double val)
  363. [DllImport (LIBNAME)]
  364. private static extern void bgsegm_BackgroundSubtractorGMG_setMaxVal_10 (IntPtr nativeObj, double val);
  365. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setMinVal(double val)
  366. [DllImport (LIBNAME)]
  367. private static extern void bgsegm_BackgroundSubtractorGMG_setMinVal_10 (IntPtr nativeObj, double val);
  368. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setNumFrames(int nframes)
  369. [DllImport (LIBNAME)]
  370. private static extern void bgsegm_BackgroundSubtractorGMG_setNumFrames_10 (IntPtr nativeObj, int nframes);
  371. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setQuantizationLevels(int nlevels)
  372. [DllImport (LIBNAME)]
  373. private static extern void bgsegm_BackgroundSubtractorGMG_setQuantizationLevels_10 (IntPtr nativeObj, int nlevels);
  374. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setSmoothingRadius(int radius)
  375. [DllImport (LIBNAME)]
  376. private static extern void bgsegm_BackgroundSubtractorGMG_setSmoothingRadius_10 (IntPtr nativeObj, int radius);
  377. // C++: void cv::bgsegm::BackgroundSubtractorGMG::setUpdateBackgroundModel(bool update)
  378. [DllImport (LIBNAME)]
  379. private static extern void bgsegm_BackgroundSubtractorGMG_setUpdateBackgroundModel_10 (IntPtr nativeObj, bool update);
  380. // native support for java finalize()
  381. [DllImport (LIBNAME)]
  382. private static extern void bgsegm_BackgroundSubtractorGMG_delete (IntPtr nativeObj);
  383. }
  384. }