BackgroundSubtractorKNN.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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.VideoModule {
  8. // C++: class BackgroundSubtractorKNN
  9. //javadoc: BackgroundSubtractorKNN
  10. public class BackgroundSubtractorKNN : BackgroundSubtractor {
  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. video_BackgroundSubtractorKNN_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal BackgroundSubtractorKNN(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new BackgroundSubtractorKNN __fromPtr__(IntPtr addr) { return new BackgroundSubtractorKNN(addr); }
  31. //
  32. // C++: bool cv::BackgroundSubtractorKNN::getDetectShadows()
  33. //
  34. //javadoc: BackgroundSubtractorKNN::getDetectShadows()
  35. public bool getDetectShadows() {
  36. ThrowIfDisposed();
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. bool retVal = video_BackgroundSubtractorKNN_getDetectShadows_10(nativeObj);
  39. return retVal;
  40. #else
  41. return false;
  42. #endif
  43. }
  44. //
  45. // C++: double cv::BackgroundSubtractorKNN::getDist2Threshold()
  46. //
  47. //javadoc: BackgroundSubtractorKNN::getDist2Threshold()
  48. public double getDist2Threshold() {
  49. ThrowIfDisposed();
  50. #if (UNITY_ANDROID && !UNITY_EDITOR)
  51. double retVal = video_BackgroundSubtractorKNN_getDist2Threshold_10(nativeObj);
  52. return retVal;
  53. #else
  54. return -1;
  55. #endif
  56. }
  57. //
  58. // C++: double cv::BackgroundSubtractorKNN::getShadowThreshold()
  59. //
  60. //javadoc: BackgroundSubtractorKNN::getShadowThreshold()
  61. public double getShadowThreshold() {
  62. ThrowIfDisposed();
  63. #if (UNITY_ANDROID && !UNITY_EDITOR)
  64. double retVal = video_BackgroundSubtractorKNN_getShadowThreshold_10(nativeObj);
  65. return retVal;
  66. #else
  67. return -1;
  68. #endif
  69. }
  70. //
  71. // C++: int cv::BackgroundSubtractorKNN::getHistory()
  72. //
  73. //javadoc: BackgroundSubtractorKNN::getHistory()
  74. public int getHistory() {
  75. ThrowIfDisposed();
  76. #if (UNITY_ANDROID && !UNITY_EDITOR)
  77. int retVal = video_BackgroundSubtractorKNN_getHistory_10(nativeObj);
  78. return retVal;
  79. #else
  80. return -1;
  81. #endif
  82. }
  83. //
  84. // C++: int cv::BackgroundSubtractorKNN::getNSamples()
  85. //
  86. //javadoc: BackgroundSubtractorKNN::getNSamples()
  87. public int getNSamples() {
  88. ThrowIfDisposed();
  89. #if (UNITY_ANDROID && !UNITY_EDITOR)
  90. int retVal = video_BackgroundSubtractorKNN_getNSamples_10(nativeObj);
  91. return retVal;
  92. #else
  93. return -1;
  94. #endif
  95. }
  96. //
  97. // C++: int cv::BackgroundSubtractorKNN::getShadowValue()
  98. //
  99. //javadoc: BackgroundSubtractorKNN::getShadowValue()
  100. public int getShadowValue() {
  101. ThrowIfDisposed();
  102. #if (UNITY_ANDROID && !UNITY_EDITOR)
  103. int retVal = video_BackgroundSubtractorKNN_getShadowValue_10(nativeObj);
  104. return retVal;
  105. #else
  106. return -1;
  107. #endif
  108. }
  109. //
  110. // C++: int cv::BackgroundSubtractorKNN::getkNNSamples()
  111. //
  112. //javadoc: BackgroundSubtractorKNN::getkNNSamples()
  113. public int getkNNSamples() {
  114. ThrowIfDisposed();
  115. #if (UNITY_ANDROID && !UNITY_EDITOR)
  116. int retVal = video_BackgroundSubtractorKNN_getkNNSamples_10(nativeObj);
  117. return retVal;
  118. #else
  119. return -1;
  120. #endif
  121. }
  122. //
  123. // C++: void cv::BackgroundSubtractorKNN::setDetectShadows(bool detectShadows)
  124. //
  125. //javadoc: BackgroundSubtractorKNN::setDetectShadows(detectShadows)
  126. public void setDetectShadows(bool detectShadows) {
  127. ThrowIfDisposed();
  128. #if (UNITY_ANDROID && !UNITY_EDITOR)
  129. video_BackgroundSubtractorKNN_setDetectShadows_10(nativeObj, detectShadows);
  130. return;
  131. #else
  132. return;
  133. #endif
  134. }
  135. //
  136. // C++: void cv::BackgroundSubtractorKNN::setDist2Threshold(double _dist2Threshold)
  137. //
  138. //javadoc: BackgroundSubtractorKNN::setDist2Threshold(_dist2Threshold)
  139. public void setDist2Threshold(double _dist2Threshold) {
  140. ThrowIfDisposed();
  141. #if (UNITY_ANDROID && !UNITY_EDITOR)
  142. video_BackgroundSubtractorKNN_setDist2Threshold_10(nativeObj, _dist2Threshold);
  143. return;
  144. #else
  145. return;
  146. #endif
  147. }
  148. //
  149. // C++: void cv::BackgroundSubtractorKNN::setHistory(int history)
  150. //
  151. //javadoc: BackgroundSubtractorKNN::setHistory(history)
  152. public void setHistory(int history) {
  153. ThrowIfDisposed();
  154. #if (UNITY_ANDROID && !UNITY_EDITOR)
  155. video_BackgroundSubtractorKNN_setHistory_10(nativeObj, history);
  156. return;
  157. #else
  158. return;
  159. #endif
  160. }
  161. //
  162. // C++: void cv::BackgroundSubtractorKNN::setNSamples(int _nN)
  163. //
  164. //javadoc: BackgroundSubtractorKNN::setNSamples(_nN)
  165. public void setNSamples(int _nN) {
  166. ThrowIfDisposed();
  167. #if (UNITY_ANDROID && !UNITY_EDITOR)
  168. video_BackgroundSubtractorKNN_setNSamples_10(nativeObj, _nN);
  169. return;
  170. #else
  171. return;
  172. #endif
  173. }
  174. //
  175. // C++: void cv::BackgroundSubtractorKNN::setShadowThreshold(double threshold)
  176. //
  177. //javadoc: BackgroundSubtractorKNN::setShadowThreshold(threshold)
  178. public void setShadowThreshold(double threshold) {
  179. ThrowIfDisposed();
  180. #if (UNITY_ANDROID && !UNITY_EDITOR)
  181. video_BackgroundSubtractorKNN_setShadowThreshold_10(nativeObj, threshold);
  182. return;
  183. #else
  184. return;
  185. #endif
  186. }
  187. //
  188. // C++: void cv::BackgroundSubtractorKNN::setShadowValue(int value)
  189. //
  190. //javadoc: BackgroundSubtractorKNN::setShadowValue(value)
  191. public void setShadowValue(int value) {
  192. ThrowIfDisposed();
  193. #if (UNITY_ANDROID && !UNITY_EDITOR)
  194. video_BackgroundSubtractorKNN_setShadowValue_10(nativeObj, value);
  195. return;
  196. #else
  197. return;
  198. #endif
  199. }
  200. //
  201. // C++: void cv::BackgroundSubtractorKNN::setkNNSamples(int _nkNN)
  202. //
  203. //javadoc: BackgroundSubtractorKNN::setkNNSamples(_nkNN)
  204. public void setkNNSamples(int _nkNN) {
  205. ThrowIfDisposed();
  206. #if (UNITY_ANDROID && !UNITY_EDITOR)
  207. video_BackgroundSubtractorKNN_setkNNSamples_10(nativeObj, _nkNN);
  208. return;
  209. #else
  210. return;
  211. #endif
  212. }
  213. #if (UNITY_ANDROID && !UNITY_EDITOR)
  214. const string LIBNAME = "opencvforunity";
  215. // C++: bool cv::BackgroundSubtractorKNN::getDetectShadows()
  216. [DllImport(LIBNAME)]
  217. private static extern bool video_BackgroundSubtractorKNN_getDetectShadows_10(IntPtr nativeObj);
  218. // C++: double cv::BackgroundSubtractorKNN::getDist2Threshold()
  219. [DllImport(LIBNAME)]
  220. private static extern double video_BackgroundSubtractorKNN_getDist2Threshold_10(IntPtr nativeObj);
  221. // C++: double cv::BackgroundSubtractorKNN::getShadowThreshold()
  222. [DllImport(LIBNAME)]
  223. private static extern double video_BackgroundSubtractorKNN_getShadowThreshold_10(IntPtr nativeObj);
  224. // C++: int cv::BackgroundSubtractorKNN::getHistory()
  225. [DllImport(LIBNAME)]
  226. private static extern int video_BackgroundSubtractorKNN_getHistory_10(IntPtr nativeObj);
  227. // C++: int cv::BackgroundSubtractorKNN::getNSamples()
  228. [DllImport(LIBNAME)]
  229. private static extern int video_BackgroundSubtractorKNN_getNSamples_10(IntPtr nativeObj);
  230. // C++: int cv::BackgroundSubtractorKNN::getShadowValue()
  231. [DllImport(LIBNAME)]
  232. private static extern int video_BackgroundSubtractorKNN_getShadowValue_10(IntPtr nativeObj);
  233. // C++: int cv::BackgroundSubtractorKNN::getkNNSamples()
  234. [DllImport(LIBNAME)]
  235. private static extern int video_BackgroundSubtractorKNN_getkNNSamples_10(IntPtr nativeObj);
  236. // C++: void cv::BackgroundSubtractorKNN::setDetectShadows(bool detectShadows)
  237. [DllImport(LIBNAME)]
  238. private static extern void video_BackgroundSubtractorKNN_setDetectShadows_10(IntPtr nativeObj, bool detectShadows);
  239. // C++: void cv::BackgroundSubtractorKNN::setDist2Threshold(double _dist2Threshold)
  240. [DllImport(LIBNAME)]
  241. private static extern void video_BackgroundSubtractorKNN_setDist2Threshold_10(IntPtr nativeObj, double _dist2Threshold);
  242. // C++: void cv::BackgroundSubtractorKNN::setHistory(int history)
  243. [DllImport(LIBNAME)]
  244. private static extern void video_BackgroundSubtractorKNN_setHistory_10(IntPtr nativeObj, int history);
  245. // C++: void cv::BackgroundSubtractorKNN::setNSamples(int _nN)
  246. [DllImport(LIBNAME)]
  247. private static extern void video_BackgroundSubtractorKNN_setNSamples_10(IntPtr nativeObj, int _nN);
  248. // C++: void cv::BackgroundSubtractorKNN::setShadowThreshold(double threshold)
  249. [DllImport(LIBNAME)]
  250. private static extern void video_BackgroundSubtractorKNN_setShadowThreshold_10(IntPtr nativeObj, double threshold);
  251. // C++: void cv::BackgroundSubtractorKNN::setShadowValue(int value)
  252. [DllImport(LIBNAME)]
  253. private static extern void video_BackgroundSubtractorKNN_setShadowValue_10(IntPtr nativeObj, int value);
  254. // C++: void cv::BackgroundSubtractorKNN::setkNNSamples(int _nkNN)
  255. [DllImport(LIBNAME)]
  256. private static extern void video_BackgroundSubtractorKNN_setkNNSamples_10(IntPtr nativeObj, int _nkNN);
  257. // native support for java finalize()
  258. [DllImport(LIBNAME)]
  259. private static extern void video_BackgroundSubtractorKNN_delete(IntPtr nativeObj);
  260. #endif
  261. }
  262. }