Bgsegm.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using OpenCVForUnity.VideoModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.BgsegmModule {
  9. // C++: class Bgsegm
  10. //javadoc: Bgsegm
  11. public class Bgsegm {
  12. // C++: enum LSBPCameraMotionCompensation
  13. public const int LSBP_CAMERA_MOTION_COMPENSATION_NONE = 0;
  14. public const int LSBP_CAMERA_MOTION_COMPENSATION_LK = 0 + 1;
  15. //
  16. // C++: Ptr_BackgroundSubtractorCNT cv::bgsegm::createBackgroundSubtractorCNT(int minPixelStability = 15, bool useHistory = true, int maxPixelStability = 15*60, bool isParallel = true)
  17. //
  18. //javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory, maxPixelStability, isParallel)
  19. public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, bool useHistory, int maxPixelStability, bool isParallel) {
  20. #if (UNITY_ANDROID && !UNITY_EDITOR)
  21. BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorCNT_10(minPixelStability, useHistory, maxPixelStability, isParallel));
  22. return retVal;
  23. #else
  24. return null;
  25. #endif
  26. }
  27. //javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory, maxPixelStability)
  28. public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, bool useHistory, int maxPixelStability) {
  29. #if (UNITY_ANDROID && !UNITY_EDITOR)
  30. BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorCNT_11(minPixelStability, useHistory, maxPixelStability));
  31. return retVal;
  32. #else
  33. return null;
  34. #endif
  35. }
  36. //javadoc: createBackgroundSubtractorCNT(minPixelStability, useHistory)
  37. public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability, bool useHistory) {
  38. #if (UNITY_ANDROID && !UNITY_EDITOR)
  39. BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorCNT_12(minPixelStability, useHistory));
  40. return retVal;
  41. #else
  42. return null;
  43. #endif
  44. }
  45. //javadoc: createBackgroundSubtractorCNT(minPixelStability)
  46. public static BackgroundSubtractorCNT createBackgroundSubtractorCNT(int minPixelStability) {
  47. #if (UNITY_ANDROID && !UNITY_EDITOR)
  48. BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorCNT_13(minPixelStability));
  49. return retVal;
  50. #else
  51. return null;
  52. #endif
  53. }
  54. //javadoc: createBackgroundSubtractorCNT()
  55. public static BackgroundSubtractorCNT createBackgroundSubtractorCNT() {
  56. #if (UNITY_ANDROID && !UNITY_EDITOR)
  57. BackgroundSubtractorCNT retVal = BackgroundSubtractorCNT.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorCNT_14());
  58. return retVal;
  59. #else
  60. return null;
  61. #endif
  62. }
  63. //
  64. // C++: Ptr_BackgroundSubtractorGMG cv::bgsegm::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
  65. //
  66. //javadoc: createBackgroundSubtractorGMG(initializationFrames, decisionThreshold)
  67. public static BackgroundSubtractorGMG createBackgroundSubtractorGMG(int initializationFrames, double decisionThreshold) {
  68. #if (UNITY_ANDROID && !UNITY_EDITOR)
  69. BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGMG_10(initializationFrames, decisionThreshold));
  70. return retVal;
  71. #else
  72. return null;
  73. #endif
  74. }
  75. //javadoc: createBackgroundSubtractorGMG(initializationFrames)
  76. public static BackgroundSubtractorGMG createBackgroundSubtractorGMG(int initializationFrames) {
  77. #if (UNITY_ANDROID && !UNITY_EDITOR)
  78. BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGMG_11(initializationFrames));
  79. return retVal;
  80. #else
  81. return null;
  82. #endif
  83. }
  84. //javadoc: createBackgroundSubtractorGMG()
  85. public static BackgroundSubtractorGMG createBackgroundSubtractorGMG() {
  86. #if (UNITY_ANDROID && !UNITY_EDITOR)
  87. BackgroundSubtractorGMG retVal = BackgroundSubtractorGMG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGMG_12());
  88. return retVal;
  89. #else
  90. return null;
  91. #endif
  92. }
  93. //
  94. // C++: Ptr_BackgroundSubtractorGSOC cv::bgsegm::createBackgroundSubtractorGSOC(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, float replaceRate = 0.003f, float propagationRate = 0.01f, int hitsThreshold = 32, float alpha = 0.01f, float beta = 0.0022f, float blinkingSupressionDecay = 0.1f, float blinkingSupressionMultiplier = 0.1f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f)
  95. //
  96. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG)
  97. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG) {
  98. #if (UNITY_ANDROID && !UNITY_EDITOR)
  99. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_10(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG));
  100. return retVal;
  101. #else
  102. return null;
  103. #endif
  104. }
  105. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG)
  106. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG) {
  107. #if (UNITY_ANDROID && !UNITY_EDITOR)
  108. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_11(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier, noiseRemovalThresholdFacBG));
  109. return retVal;
  110. #else
  111. return null;
  112. #endif
  113. }
  114. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier)
  115. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier) {
  116. #if (UNITY_ANDROID && !UNITY_EDITOR)
  117. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_12(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay, blinkingSupressionMultiplier));
  118. return retVal;
  119. #else
  120. return null;
  121. #endif
  122. }
  123. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay)
  124. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay) {
  125. #if (UNITY_ANDROID && !UNITY_EDITOR)
  126. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_13(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta, blinkingSupressionDecay));
  127. return retVal;
  128. #else
  129. return null;
  130. #endif
  131. }
  132. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta)
  133. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta) {
  134. #if (UNITY_ANDROID && !UNITY_EDITOR)
  135. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_14(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha, beta));
  136. return retVal;
  137. #else
  138. return null;
  139. #endif
  140. }
  141. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha)
  142. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha) {
  143. #if (UNITY_ANDROID && !UNITY_EDITOR)
  144. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_15(mc, nSamples, replaceRate, propagationRate, hitsThreshold, alpha));
  145. return retVal;
  146. #else
  147. return null;
  148. #endif
  149. }
  150. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate, hitsThreshold)
  151. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold) {
  152. #if (UNITY_ANDROID && !UNITY_EDITOR)
  153. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_16(mc, nSamples, replaceRate, propagationRate, hitsThreshold));
  154. return retVal;
  155. #else
  156. return null;
  157. #endif
  158. }
  159. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate, propagationRate)
  160. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate, float propagationRate) {
  161. #if (UNITY_ANDROID && !UNITY_EDITOR)
  162. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_17(mc, nSamples, replaceRate, propagationRate));
  163. return retVal;
  164. #else
  165. return null;
  166. #endif
  167. }
  168. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples, replaceRate)
  169. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples, float replaceRate) {
  170. #if (UNITY_ANDROID && !UNITY_EDITOR)
  171. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_18(mc, nSamples, replaceRate));
  172. return retVal;
  173. #else
  174. return null;
  175. #endif
  176. }
  177. //javadoc: createBackgroundSubtractorGSOC(mc, nSamples)
  178. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc, int nSamples) {
  179. #if (UNITY_ANDROID && !UNITY_EDITOR)
  180. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_19(mc, nSamples));
  181. return retVal;
  182. #else
  183. return null;
  184. #endif
  185. }
  186. //javadoc: createBackgroundSubtractorGSOC(mc)
  187. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC(int mc) {
  188. #if (UNITY_ANDROID && !UNITY_EDITOR)
  189. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_110(mc));
  190. return retVal;
  191. #else
  192. return null;
  193. #endif
  194. }
  195. //javadoc: createBackgroundSubtractorGSOC()
  196. public static BackgroundSubtractorGSOC createBackgroundSubtractorGSOC() {
  197. #if (UNITY_ANDROID && !UNITY_EDITOR)
  198. BackgroundSubtractorGSOC retVal = BackgroundSubtractorGSOC.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorGSOC_111());
  199. return retVal;
  200. #else
  201. return null;
  202. #endif
  203. }
  204. //
  205. // C++: Ptr_BackgroundSubtractorLSBP cv::bgsegm::createBackgroundSubtractorLSBP(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, int LSBPRadius = 16, float Tlower = 2.0f, float Tupper = 32.0f, float Tinc = 1.0f, float Tdec = 0.05f, float Rscale = 10.0f, float Rincdec = 0.005f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f, int LSBPthreshold = 8, int minCount = 2)
  206. //
  207. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold, minCount)
  208. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold, int minCount) {
  209. #if (UNITY_ANDROID && !UNITY_EDITOR)
  210. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_10(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold, minCount));
  211. return retVal;
  212. #else
  213. return null;
  214. #endif
  215. }
  216. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold)
  217. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold) {
  218. #if (UNITY_ANDROID && !UNITY_EDITOR)
  219. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_11(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG, LSBPthreshold));
  220. return retVal;
  221. #else
  222. return null;
  223. #endif
  224. }
  225. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG)
  226. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG) {
  227. #if (UNITY_ANDROID && !UNITY_EDITOR)
  228. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_12(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG, noiseRemovalThresholdFacFG));
  229. return retVal;
  230. #else
  231. return null;
  232. #endif
  233. }
  234. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG)
  235. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG) {
  236. #if (UNITY_ANDROID && !UNITY_EDITOR)
  237. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_13(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec, noiseRemovalThresholdFacBG));
  238. return retVal;
  239. #else
  240. return null;
  241. #endif
  242. }
  243. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec)
  244. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec) {
  245. #if (UNITY_ANDROID && !UNITY_EDITOR)
  246. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_14(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale, Rincdec));
  247. return retVal;
  248. #else
  249. return null;
  250. #endif
  251. }
  252. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale)
  253. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale) {
  254. #if (UNITY_ANDROID && !UNITY_EDITOR)
  255. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_15(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec, Rscale));
  256. return retVal;
  257. #else
  258. return null;
  259. #endif
  260. }
  261. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec)
  262. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec) {
  263. #if (UNITY_ANDROID && !UNITY_EDITOR)
  264. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_16(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc, Tdec));
  265. return retVal;
  266. #else
  267. return null;
  268. #endif
  269. }
  270. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc)
  271. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc) {
  272. #if (UNITY_ANDROID && !UNITY_EDITOR)
  273. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_17(mc, nSamples, LSBPRadius, Tlower, Tupper, Tinc));
  274. return retVal;
  275. #else
  276. return null;
  277. #endif
  278. }
  279. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower, Tupper)
  280. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper) {
  281. #if (UNITY_ANDROID && !UNITY_EDITOR)
  282. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_18(mc, nSamples, LSBPRadius, Tlower, Tupper));
  283. return retVal;
  284. #else
  285. return null;
  286. #endif
  287. }
  288. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius, Tlower)
  289. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius, float Tlower) {
  290. #if (UNITY_ANDROID && !UNITY_EDITOR)
  291. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_19(mc, nSamples, LSBPRadius, Tlower));
  292. return retVal;
  293. #else
  294. return null;
  295. #endif
  296. }
  297. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples, LSBPRadius)
  298. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples, int LSBPRadius) {
  299. #if (UNITY_ANDROID && !UNITY_EDITOR)
  300. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_110(mc, nSamples, LSBPRadius));
  301. return retVal;
  302. #else
  303. return null;
  304. #endif
  305. }
  306. //javadoc: createBackgroundSubtractorLSBP(mc, nSamples)
  307. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc, int nSamples) {
  308. #if (UNITY_ANDROID && !UNITY_EDITOR)
  309. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_111(mc, nSamples));
  310. return retVal;
  311. #else
  312. return null;
  313. #endif
  314. }
  315. //javadoc: createBackgroundSubtractorLSBP(mc)
  316. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP(int mc) {
  317. #if (UNITY_ANDROID && !UNITY_EDITOR)
  318. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_112(mc));
  319. return retVal;
  320. #else
  321. return null;
  322. #endif
  323. }
  324. //javadoc: createBackgroundSubtractorLSBP()
  325. public static BackgroundSubtractorLSBP createBackgroundSubtractorLSBP() {
  326. #if (UNITY_ANDROID && !UNITY_EDITOR)
  327. BackgroundSubtractorLSBP retVal = BackgroundSubtractorLSBP.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorLSBP_113());
  328. return retVal;
  329. #else
  330. return null;
  331. #endif
  332. }
  333. //
  334. // C++: Ptr_BackgroundSubtractorMOG cv::bgsegm::createBackgroundSubtractorMOG(int history = 200, int nmixtures = 5, double backgroundRatio = 0.7, double noiseSigma = 0)
  335. //
  336. //javadoc: createBackgroundSubtractorMOG(history, nmixtures, backgroundRatio, noiseSigma)
  337. public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio, double noiseSigma) {
  338. #if (UNITY_ANDROID && !UNITY_EDITOR)
  339. BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorMOG_10(history, nmixtures, backgroundRatio, noiseSigma));
  340. return retVal;
  341. #else
  342. return null;
  343. #endif
  344. }
  345. //javadoc: createBackgroundSubtractorMOG(history, nmixtures, backgroundRatio)
  346. public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures, double backgroundRatio) {
  347. #if (UNITY_ANDROID && !UNITY_EDITOR)
  348. BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorMOG_11(history, nmixtures, backgroundRatio));
  349. return retVal;
  350. #else
  351. return null;
  352. #endif
  353. }
  354. //javadoc: createBackgroundSubtractorMOG(history, nmixtures)
  355. public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history, int nmixtures) {
  356. #if (UNITY_ANDROID && !UNITY_EDITOR)
  357. BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorMOG_12(history, nmixtures));
  358. return retVal;
  359. #else
  360. return null;
  361. #endif
  362. }
  363. //javadoc: createBackgroundSubtractorMOG(history)
  364. public static BackgroundSubtractorMOG createBackgroundSubtractorMOG(int history) {
  365. #if (UNITY_ANDROID && !UNITY_EDITOR)
  366. BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorMOG_13(history));
  367. return retVal;
  368. #else
  369. return null;
  370. #endif
  371. }
  372. //javadoc: createBackgroundSubtractorMOG()
  373. public static BackgroundSubtractorMOG createBackgroundSubtractorMOG() {
  374. #if (UNITY_ANDROID && !UNITY_EDITOR)
  375. BackgroundSubtractorMOG retVal = BackgroundSubtractorMOG.__fromPtr__(bgsegm_Bgsegm_createBackgroundSubtractorMOG_14());
  376. return retVal;
  377. #else
  378. return null;
  379. #endif
  380. }
  381. //
  382. // C++: Ptr_SyntheticSequenceGenerator cv::bgsegm::createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude = 2.0, double wavelength = 20.0, double wavespeed = 0.2, double objspeed = 6.0)
  383. //
  384. //javadoc: createSyntheticSequenceGenerator(background, _object, amplitude, wavelength, wavespeed, objspeed)
  385. public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude, double wavelength, double wavespeed, double objspeed) {
  386. if (background != null) background.ThrowIfDisposed();
  387. if (_object != null) _object.ThrowIfDisposed();
  388. #if (UNITY_ANDROID && !UNITY_EDITOR)
  389. SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(bgsegm_Bgsegm_createSyntheticSequenceGenerator_10(background.nativeObj, _object.nativeObj, amplitude, wavelength, wavespeed, objspeed));
  390. return retVal;
  391. #else
  392. return null;
  393. #endif
  394. }
  395. //javadoc: createSyntheticSequenceGenerator(background, _object, amplitude, wavelength, wavespeed)
  396. public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude, double wavelength, double wavespeed) {
  397. if (background != null) background.ThrowIfDisposed();
  398. if (_object != null) _object.ThrowIfDisposed();
  399. #if (UNITY_ANDROID && !UNITY_EDITOR)
  400. SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(bgsegm_Bgsegm_createSyntheticSequenceGenerator_11(background.nativeObj, _object.nativeObj, amplitude, wavelength, wavespeed));
  401. return retVal;
  402. #else
  403. return null;
  404. #endif
  405. }
  406. //javadoc: createSyntheticSequenceGenerator(background, _object, amplitude, wavelength)
  407. public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude, double wavelength) {
  408. if (background != null) background.ThrowIfDisposed();
  409. if (_object != null) _object.ThrowIfDisposed();
  410. #if (UNITY_ANDROID && !UNITY_EDITOR)
  411. SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(bgsegm_Bgsegm_createSyntheticSequenceGenerator_12(background.nativeObj, _object.nativeObj, amplitude, wavelength));
  412. return retVal;
  413. #else
  414. return null;
  415. #endif
  416. }
  417. //javadoc: createSyntheticSequenceGenerator(background, _object, amplitude)
  418. public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude) {
  419. if (background != null) background.ThrowIfDisposed();
  420. if (_object != null) _object.ThrowIfDisposed();
  421. #if (UNITY_ANDROID && !UNITY_EDITOR)
  422. SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(bgsegm_Bgsegm_createSyntheticSequenceGenerator_13(background.nativeObj, _object.nativeObj, amplitude));
  423. return retVal;
  424. #else
  425. return null;
  426. #endif
  427. }
  428. //javadoc: createSyntheticSequenceGenerator(background, _object)
  429. public static SyntheticSequenceGenerator createSyntheticSequenceGenerator(Mat background, Mat _object) {
  430. if (background != null) background.ThrowIfDisposed();
  431. if (_object != null) _object.ThrowIfDisposed();
  432. #if (UNITY_ANDROID && !UNITY_EDITOR)
  433. SyntheticSequenceGenerator retVal = SyntheticSequenceGenerator.__fromPtr__(bgsegm_Bgsegm_createSyntheticSequenceGenerator_14(background.nativeObj, _object.nativeObj));
  434. return retVal;
  435. #else
  436. return null;
  437. #endif
  438. }
  439. #if (UNITY_ANDROID && !UNITY_EDITOR)
  440. const string LIBNAME = "opencvforunity";
  441. // C++: Ptr_BackgroundSubtractorCNT cv::bgsegm::createBackgroundSubtractorCNT(int minPixelStability = 15, bool useHistory = true, int maxPixelStability = 15*60, bool isParallel = true)
  442. [DllImport(LIBNAME)]
  443. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorCNT_10(int minPixelStability, bool useHistory, int maxPixelStability, bool isParallel);
  444. [DllImport(LIBNAME)]
  445. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorCNT_11(int minPixelStability, bool useHistory, int maxPixelStability);
  446. [DllImport(LIBNAME)]
  447. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorCNT_12(int minPixelStability, bool useHistory);
  448. [DllImport(LIBNAME)]
  449. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorCNT_13(int minPixelStability);
  450. [DllImport(LIBNAME)]
  451. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorCNT_14();
  452. // C++: Ptr_BackgroundSubtractorGMG cv::bgsegm::createBackgroundSubtractorGMG(int initializationFrames = 120, double decisionThreshold = 0.8)
  453. [DllImport(LIBNAME)]
  454. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGMG_10(int initializationFrames, double decisionThreshold);
  455. [DllImport(LIBNAME)]
  456. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGMG_11(int initializationFrames);
  457. [DllImport(LIBNAME)]
  458. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGMG_12();
  459. // C++: Ptr_BackgroundSubtractorGSOC cv::bgsegm::createBackgroundSubtractorGSOC(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, float replaceRate = 0.003f, float propagationRate = 0.01f, int hitsThreshold = 32, float alpha = 0.01f, float beta = 0.0022f, float blinkingSupressionDecay = 0.1f, float blinkingSupressionMultiplier = 0.1f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f)
  460. [DllImport(LIBNAME)]
  461. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_10(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG);
  462. [DllImport(LIBNAME)]
  463. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_11(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier, float noiseRemovalThresholdFacBG);
  464. [DllImport(LIBNAME)]
  465. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_12(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay, float blinkingSupressionMultiplier);
  466. [DllImport(LIBNAME)]
  467. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_13(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta, float blinkingSupressionDecay);
  468. [DllImport(LIBNAME)]
  469. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_14(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha, float beta);
  470. [DllImport(LIBNAME)]
  471. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_15(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold, float alpha);
  472. [DllImport(LIBNAME)]
  473. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_16(int mc, int nSamples, float replaceRate, float propagationRate, int hitsThreshold);
  474. [DllImport(LIBNAME)]
  475. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_17(int mc, int nSamples, float replaceRate, float propagationRate);
  476. [DllImport(LIBNAME)]
  477. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_18(int mc, int nSamples, float replaceRate);
  478. [DllImport(LIBNAME)]
  479. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_19(int mc, int nSamples);
  480. [DllImport(LIBNAME)]
  481. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_110(int mc);
  482. [DllImport(LIBNAME)]
  483. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorGSOC_111();
  484. // C++: Ptr_BackgroundSubtractorLSBP cv::bgsegm::createBackgroundSubtractorLSBP(int mc = LSBP_CAMERA_MOTION_COMPENSATION_NONE, int nSamples = 20, int LSBPRadius = 16, float Tlower = 2.0f, float Tupper = 32.0f, float Tinc = 1.0f, float Tdec = 0.05f, float Rscale = 10.0f, float Rincdec = 0.005f, float noiseRemovalThresholdFacBG = 0.0004f, float noiseRemovalThresholdFacFG = 0.0008f, int LSBPthreshold = 8, int minCount = 2)
  485. [DllImport(LIBNAME)]
  486. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_10(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold, int minCount);
  487. [DllImport(LIBNAME)]
  488. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_11(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG, int LSBPthreshold);
  489. [DllImport(LIBNAME)]
  490. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_12(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG, float noiseRemovalThresholdFacFG);
  491. [DllImport(LIBNAME)]
  492. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_13(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec, float noiseRemovalThresholdFacBG);
  493. [DllImport(LIBNAME)]
  494. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_14(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale, float Rincdec);
  495. [DllImport(LIBNAME)]
  496. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_15(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec, float Rscale);
  497. [DllImport(LIBNAME)]
  498. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_16(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc, float Tdec);
  499. [DllImport(LIBNAME)]
  500. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_17(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper, float Tinc);
  501. [DllImport(LIBNAME)]
  502. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_18(int mc, int nSamples, int LSBPRadius, float Tlower, float Tupper);
  503. [DllImport(LIBNAME)]
  504. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_19(int mc, int nSamples, int LSBPRadius, float Tlower);
  505. [DllImport(LIBNAME)]
  506. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_110(int mc, int nSamples, int LSBPRadius);
  507. [DllImport(LIBNAME)]
  508. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_111(int mc, int nSamples);
  509. [DllImport(LIBNAME)]
  510. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_112(int mc);
  511. [DllImport(LIBNAME)]
  512. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorLSBP_113();
  513. // C++: Ptr_BackgroundSubtractorMOG cv::bgsegm::createBackgroundSubtractorMOG(int history = 200, int nmixtures = 5, double backgroundRatio = 0.7, double noiseSigma = 0)
  514. [DllImport(LIBNAME)]
  515. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorMOG_10(int history, int nmixtures, double backgroundRatio, double noiseSigma);
  516. [DllImport(LIBNAME)]
  517. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorMOG_11(int history, int nmixtures, double backgroundRatio);
  518. [DllImport(LIBNAME)]
  519. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorMOG_12(int history, int nmixtures);
  520. [DllImport(LIBNAME)]
  521. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorMOG_13(int history);
  522. [DllImport(LIBNAME)]
  523. private static extern IntPtr bgsegm_Bgsegm_createBackgroundSubtractorMOG_14();
  524. // C++: Ptr_SyntheticSequenceGenerator cv::bgsegm::createSyntheticSequenceGenerator(Mat background, Mat _object, double amplitude = 2.0, double wavelength = 20.0, double wavespeed = 0.2, double objspeed = 6.0)
  525. [DllImport(LIBNAME)]
  526. private static extern IntPtr bgsegm_Bgsegm_createSyntheticSequenceGenerator_10(IntPtr background_nativeObj, IntPtr _object_nativeObj, double amplitude, double wavelength, double wavespeed, double objspeed);
  527. [DllImport(LIBNAME)]
  528. private static extern IntPtr bgsegm_Bgsegm_createSyntheticSequenceGenerator_11(IntPtr background_nativeObj, IntPtr _object_nativeObj, double amplitude, double wavelength, double wavespeed);
  529. [DllImport(LIBNAME)]
  530. private static extern IntPtr bgsegm_Bgsegm_createSyntheticSequenceGenerator_12(IntPtr background_nativeObj, IntPtr _object_nativeObj, double amplitude, double wavelength);
  531. [DllImport(LIBNAME)]
  532. private static extern IntPtr bgsegm_Bgsegm_createSyntheticSequenceGenerator_13(IntPtr background_nativeObj, IntPtr _object_nativeObj, double amplitude);
  533. [DllImport(LIBNAME)]
  534. private static extern IntPtr bgsegm_Bgsegm_createSyntheticSequenceGenerator_14(IntPtr background_nativeObj, IntPtr _object_nativeObj);
  535. #endif
  536. }
  537. }