DISOpticalFlow.cs 17 KB

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