DISOpticalFlow.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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 DISOpticalFlow
  9. //javadoc: DISOpticalFlow
  10. public class DISOpticalFlow : DenseOpticalFlow {
  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_DISOpticalFlow_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal DISOpticalFlow(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new DISOpticalFlow __fromPtr__(IntPtr addr) { return new DISOpticalFlow(addr); }
  31. // C++: enum <unnamed>
  32. public const int PRESET_ULTRAFAST = 0;
  33. public const int PRESET_FAST = 1;
  34. public const int PRESET_MEDIUM = 2;
  35. //
  36. // C++: static Ptr_DISOpticalFlow cv::DISOpticalFlow::create(int preset = DISOpticalFlow::PRESET_FAST)
  37. //
  38. //javadoc: DISOpticalFlow::create(preset)
  39. public static DISOpticalFlow create(int preset) {
  40. #if (UNITY_ANDROID && !UNITY_EDITOR)
  41. DISOpticalFlow retVal = DISOpticalFlow.__fromPtr__(video_DISOpticalFlow_create_10(preset));
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //javadoc: DISOpticalFlow::create()
  48. public static DISOpticalFlow create() {
  49. #if (UNITY_ANDROID && !UNITY_EDITOR)
  50. DISOpticalFlow retVal = DISOpticalFlow.__fromPtr__(video_DISOpticalFlow_create_11());
  51. return retVal;
  52. #else
  53. return null;
  54. #endif
  55. }
  56. //
  57. // C++: bool cv::DISOpticalFlow::getUseMeanNormalization()
  58. //
  59. //javadoc: DISOpticalFlow::getUseMeanNormalization()
  60. public bool getUseMeanNormalization() {
  61. ThrowIfDisposed();
  62. #if (UNITY_ANDROID && !UNITY_EDITOR)
  63. bool retVal = video_DISOpticalFlow_getUseMeanNormalization_10(nativeObj);
  64. return retVal;
  65. #else
  66. return false;
  67. #endif
  68. }
  69. //
  70. // C++: bool cv::DISOpticalFlow::getUseSpatialPropagation()
  71. //
  72. //javadoc: DISOpticalFlow::getUseSpatialPropagation()
  73. public bool getUseSpatialPropagation() {
  74. ThrowIfDisposed();
  75. #if (UNITY_ANDROID && !UNITY_EDITOR)
  76. bool retVal = video_DISOpticalFlow_getUseSpatialPropagation_10(nativeObj);
  77. return retVal;
  78. #else
  79. return false;
  80. #endif
  81. }
  82. //
  83. // C++: float cv::DISOpticalFlow::getVariationalRefinementAlpha()
  84. //
  85. //javadoc: DISOpticalFlow::getVariationalRefinementAlpha()
  86. public float getVariationalRefinementAlpha() {
  87. ThrowIfDisposed();
  88. #if (UNITY_ANDROID && !UNITY_EDITOR)
  89. float retVal = video_DISOpticalFlow_getVariationalRefinementAlpha_10(nativeObj);
  90. return retVal;
  91. #else
  92. return -1;
  93. #endif
  94. }
  95. //
  96. // C++: float cv::DISOpticalFlow::getVariationalRefinementDelta()
  97. //
  98. //javadoc: DISOpticalFlow::getVariationalRefinementDelta()
  99. public float getVariationalRefinementDelta() {
  100. ThrowIfDisposed();
  101. #if (UNITY_ANDROID && !UNITY_EDITOR)
  102. float retVal = video_DISOpticalFlow_getVariationalRefinementDelta_10(nativeObj);
  103. return retVal;
  104. #else
  105. return -1;
  106. #endif
  107. }
  108. //
  109. // C++: float cv::DISOpticalFlow::getVariationalRefinementGamma()
  110. //
  111. //javadoc: DISOpticalFlow::getVariationalRefinementGamma()
  112. public float getVariationalRefinementGamma() {
  113. ThrowIfDisposed();
  114. #if (UNITY_ANDROID && !UNITY_EDITOR)
  115. float retVal = video_DISOpticalFlow_getVariationalRefinementGamma_10(nativeObj);
  116. return retVal;
  117. #else
  118. return -1;
  119. #endif
  120. }
  121. //
  122. // C++: int cv::DISOpticalFlow::getFinestScale()
  123. //
  124. //javadoc: DISOpticalFlow::getFinestScale()
  125. public int getFinestScale() {
  126. ThrowIfDisposed();
  127. #if (UNITY_ANDROID && !UNITY_EDITOR)
  128. int retVal = video_DISOpticalFlow_getFinestScale_10(nativeObj);
  129. return retVal;
  130. #else
  131. return -1;
  132. #endif
  133. }
  134. //
  135. // C++: int cv::DISOpticalFlow::getGradientDescentIterations()
  136. //
  137. //javadoc: DISOpticalFlow::getGradientDescentIterations()
  138. public int getGradientDescentIterations() {
  139. ThrowIfDisposed();
  140. #if (UNITY_ANDROID && !UNITY_EDITOR)
  141. int retVal = video_DISOpticalFlow_getGradientDescentIterations_10(nativeObj);
  142. return retVal;
  143. #else
  144. return -1;
  145. #endif
  146. }
  147. //
  148. // C++: int cv::DISOpticalFlow::getPatchSize()
  149. //
  150. //javadoc: DISOpticalFlow::getPatchSize()
  151. public int getPatchSize() {
  152. ThrowIfDisposed();
  153. #if (UNITY_ANDROID && !UNITY_EDITOR)
  154. int retVal = video_DISOpticalFlow_getPatchSize_10(nativeObj);
  155. return retVal;
  156. #else
  157. return -1;
  158. #endif
  159. }
  160. //
  161. // C++: int cv::DISOpticalFlow::getPatchStride()
  162. //
  163. //javadoc: DISOpticalFlow::getPatchStride()
  164. public int getPatchStride() {
  165. ThrowIfDisposed();
  166. #if (UNITY_ANDROID && !UNITY_EDITOR)
  167. int retVal = video_DISOpticalFlow_getPatchStride_10(nativeObj);
  168. return retVal;
  169. #else
  170. return -1;
  171. #endif
  172. }
  173. //
  174. // C++: int cv::DISOpticalFlow::getVariationalRefinementIterations()
  175. //
  176. //javadoc: DISOpticalFlow::getVariationalRefinementIterations()
  177. public int getVariationalRefinementIterations() {
  178. ThrowIfDisposed();
  179. #if (UNITY_ANDROID && !UNITY_EDITOR)
  180. int retVal = video_DISOpticalFlow_getVariationalRefinementIterations_10(nativeObj);
  181. return retVal;
  182. #else
  183. return -1;
  184. #endif
  185. }
  186. //
  187. // C++: void cv::DISOpticalFlow::setFinestScale(int val)
  188. //
  189. //javadoc: DISOpticalFlow::setFinestScale(val)
  190. public void setFinestScale(int val) {
  191. ThrowIfDisposed();
  192. #if (UNITY_ANDROID && !UNITY_EDITOR)
  193. video_DISOpticalFlow_setFinestScale_10(nativeObj, val);
  194. return;
  195. #else
  196. return;
  197. #endif
  198. }
  199. //
  200. // C++: void cv::DISOpticalFlow::setGradientDescentIterations(int val)
  201. //
  202. //javadoc: DISOpticalFlow::setGradientDescentIterations(val)
  203. public void setGradientDescentIterations(int val) {
  204. ThrowIfDisposed();
  205. #if (UNITY_ANDROID && !UNITY_EDITOR)
  206. video_DISOpticalFlow_setGradientDescentIterations_10(nativeObj, val);
  207. return;
  208. #else
  209. return;
  210. #endif
  211. }
  212. //
  213. // C++: void cv::DISOpticalFlow::setPatchSize(int val)
  214. //
  215. //javadoc: DISOpticalFlow::setPatchSize(val)
  216. public void setPatchSize(int val) {
  217. ThrowIfDisposed();
  218. #if (UNITY_ANDROID && !UNITY_EDITOR)
  219. video_DISOpticalFlow_setPatchSize_10(nativeObj, val);
  220. return;
  221. #else
  222. return;
  223. #endif
  224. }
  225. //
  226. // C++: void cv::DISOpticalFlow::setPatchStride(int val)
  227. //
  228. //javadoc: DISOpticalFlow::setPatchStride(val)
  229. public void setPatchStride(int val) {
  230. ThrowIfDisposed();
  231. #if (UNITY_ANDROID && !UNITY_EDITOR)
  232. video_DISOpticalFlow_setPatchStride_10(nativeObj, val);
  233. return;
  234. #else
  235. return;
  236. #endif
  237. }
  238. //
  239. // C++: void cv::DISOpticalFlow::setUseMeanNormalization(bool val)
  240. //
  241. //javadoc: DISOpticalFlow::setUseMeanNormalization(val)
  242. public void setUseMeanNormalization(bool val) {
  243. ThrowIfDisposed();
  244. #if (UNITY_ANDROID && !UNITY_EDITOR)
  245. video_DISOpticalFlow_setUseMeanNormalization_10(nativeObj, val);
  246. return;
  247. #else
  248. return;
  249. #endif
  250. }
  251. //
  252. // C++: void cv::DISOpticalFlow::setUseSpatialPropagation(bool val)
  253. //
  254. //javadoc: DISOpticalFlow::setUseSpatialPropagation(val)
  255. public void setUseSpatialPropagation(bool val) {
  256. ThrowIfDisposed();
  257. #if (UNITY_ANDROID && !UNITY_EDITOR)
  258. video_DISOpticalFlow_setUseSpatialPropagation_10(nativeObj, val);
  259. return;
  260. #else
  261. return;
  262. #endif
  263. }
  264. //
  265. // C++: void cv::DISOpticalFlow::setVariationalRefinementAlpha(float val)
  266. //
  267. //javadoc: DISOpticalFlow::setVariationalRefinementAlpha(val)
  268. public void setVariationalRefinementAlpha(float val) {
  269. ThrowIfDisposed();
  270. #if (UNITY_ANDROID && !UNITY_EDITOR)
  271. video_DISOpticalFlow_setVariationalRefinementAlpha_10(nativeObj, val);
  272. return;
  273. #else
  274. return;
  275. #endif
  276. }
  277. //
  278. // C++: void cv::DISOpticalFlow::setVariationalRefinementDelta(float val)
  279. //
  280. //javadoc: DISOpticalFlow::setVariationalRefinementDelta(val)
  281. public void setVariationalRefinementDelta(float val) {
  282. ThrowIfDisposed();
  283. #if (UNITY_ANDROID && !UNITY_EDITOR)
  284. video_DISOpticalFlow_setVariationalRefinementDelta_10(nativeObj, val);
  285. return;
  286. #else
  287. return;
  288. #endif
  289. }
  290. //
  291. // C++: void cv::DISOpticalFlow::setVariationalRefinementGamma(float val)
  292. //
  293. //javadoc: DISOpticalFlow::setVariationalRefinementGamma(val)
  294. public void setVariationalRefinementGamma(float val) {
  295. ThrowIfDisposed();
  296. #if (UNITY_ANDROID && !UNITY_EDITOR)
  297. video_DISOpticalFlow_setVariationalRefinementGamma_10(nativeObj, val);
  298. return;
  299. #else
  300. return;
  301. #endif
  302. }
  303. //
  304. // C++: void cv::DISOpticalFlow::setVariationalRefinementIterations(int val)
  305. //
  306. //javadoc: DISOpticalFlow::setVariationalRefinementIterations(val)
  307. public void setVariationalRefinementIterations(int val) {
  308. ThrowIfDisposed();
  309. #if (UNITY_ANDROID && !UNITY_EDITOR)
  310. video_DISOpticalFlow_setVariationalRefinementIterations_10(nativeObj, val);
  311. return;
  312. #else
  313. return;
  314. #endif
  315. }
  316. #if (UNITY_ANDROID && !UNITY_EDITOR)
  317. const string LIBNAME = "opencvforunity";
  318. // C++: static Ptr_DISOpticalFlow cv::DISOpticalFlow::create(int preset = DISOpticalFlow::PRESET_FAST)
  319. [DllImport(LIBNAME)]
  320. private static extern IntPtr video_DISOpticalFlow_create_10(int preset);
  321. [DllImport(LIBNAME)]
  322. private static extern IntPtr video_DISOpticalFlow_create_11();
  323. // C++: bool cv::DISOpticalFlow::getUseMeanNormalization()
  324. [DllImport(LIBNAME)]
  325. private static extern bool video_DISOpticalFlow_getUseMeanNormalization_10(IntPtr nativeObj);
  326. // C++: bool cv::DISOpticalFlow::getUseSpatialPropagation()
  327. [DllImport(LIBNAME)]
  328. private static extern bool video_DISOpticalFlow_getUseSpatialPropagation_10(IntPtr nativeObj);
  329. // C++: float cv::DISOpticalFlow::getVariationalRefinementAlpha()
  330. [DllImport(LIBNAME)]
  331. private static extern float video_DISOpticalFlow_getVariationalRefinementAlpha_10(IntPtr nativeObj);
  332. // C++: float cv::DISOpticalFlow::getVariationalRefinementDelta()
  333. [DllImport(LIBNAME)]
  334. private static extern float video_DISOpticalFlow_getVariationalRefinementDelta_10(IntPtr nativeObj);
  335. // C++: float cv::DISOpticalFlow::getVariationalRefinementGamma()
  336. [DllImport(LIBNAME)]
  337. private static extern float video_DISOpticalFlow_getVariationalRefinementGamma_10(IntPtr nativeObj);
  338. // C++: int cv::DISOpticalFlow::getFinestScale()
  339. [DllImport(LIBNAME)]
  340. private static extern int video_DISOpticalFlow_getFinestScale_10(IntPtr nativeObj);
  341. // C++: int cv::DISOpticalFlow::getGradientDescentIterations()
  342. [DllImport(LIBNAME)]
  343. private static extern int video_DISOpticalFlow_getGradientDescentIterations_10(IntPtr nativeObj);
  344. // C++: int cv::DISOpticalFlow::getPatchSize()
  345. [DllImport(LIBNAME)]
  346. private static extern int video_DISOpticalFlow_getPatchSize_10(IntPtr nativeObj);
  347. // C++: int cv::DISOpticalFlow::getPatchStride()
  348. [DllImport(LIBNAME)]
  349. private static extern int video_DISOpticalFlow_getPatchStride_10(IntPtr nativeObj);
  350. // C++: int cv::DISOpticalFlow::getVariationalRefinementIterations()
  351. [DllImport(LIBNAME)]
  352. private static extern int video_DISOpticalFlow_getVariationalRefinementIterations_10(IntPtr nativeObj);
  353. // C++: void cv::DISOpticalFlow::setFinestScale(int val)
  354. [DllImport(LIBNAME)]
  355. private static extern void video_DISOpticalFlow_setFinestScale_10(IntPtr nativeObj, int val);
  356. // C++: void cv::DISOpticalFlow::setGradientDescentIterations(int val)
  357. [DllImport(LIBNAME)]
  358. private static extern void video_DISOpticalFlow_setGradientDescentIterations_10(IntPtr nativeObj, int val);
  359. // C++: void cv::DISOpticalFlow::setPatchSize(int val)
  360. [DllImport(LIBNAME)]
  361. private static extern void video_DISOpticalFlow_setPatchSize_10(IntPtr nativeObj, int val);
  362. // C++: void cv::DISOpticalFlow::setPatchStride(int val)
  363. [DllImport(LIBNAME)]
  364. private static extern void video_DISOpticalFlow_setPatchStride_10(IntPtr nativeObj, int val);
  365. // C++: void cv::DISOpticalFlow::setUseMeanNormalization(bool val)
  366. [DllImport(LIBNAME)]
  367. private static extern void video_DISOpticalFlow_setUseMeanNormalization_10(IntPtr nativeObj, bool val);
  368. // C++: void cv::DISOpticalFlow::setUseSpatialPropagation(bool val)
  369. [DllImport(LIBNAME)]
  370. private static extern void video_DISOpticalFlow_setUseSpatialPropagation_10(IntPtr nativeObj, bool val);
  371. // C++: void cv::DISOpticalFlow::setVariationalRefinementAlpha(float val)
  372. [DllImport(LIBNAME)]
  373. private static extern void video_DISOpticalFlow_setVariationalRefinementAlpha_10(IntPtr nativeObj, float val);
  374. // C++: void cv::DISOpticalFlow::setVariationalRefinementDelta(float val)
  375. [DllImport(LIBNAME)]
  376. private static extern void video_DISOpticalFlow_setVariationalRefinementDelta_10(IntPtr nativeObj, float val);
  377. // C++: void cv::DISOpticalFlow::setVariationalRefinementGamma(float val)
  378. [DllImport(LIBNAME)]
  379. private static extern void video_DISOpticalFlow_setVariationalRefinementGamma_10(IntPtr nativeObj, float val);
  380. // C++: void cv::DISOpticalFlow::setVariationalRefinementIterations(int val)
  381. [DllImport(LIBNAME)]
  382. private static extern void video_DISOpticalFlow_setVariationalRefinementIterations_10(IntPtr nativeObj, int val);
  383. // native support for java finalize()
  384. [DllImport(LIBNAME)]
  385. private static extern void video_DISOpticalFlow_delete(IntPtr nativeObj);
  386. #endif
  387. }
  388. }