VariationalRefinement.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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 VariationalRefinement
  10. //javadoc: VariationalRefinement
  11. public class VariationalRefinement : 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_VariationalRefinement_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal VariationalRefinement (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new VariationalRefinement __fromPtr__ (IntPtr addr) { return new VariationalRefinement (addr); }
  34. //
  35. // C++: static Ptr_VariationalRefinement cv::VariationalRefinement::create()
  36. //
  37. //javadoc: VariationalRefinement::create()
  38. public static VariationalRefinement create ()
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. VariationalRefinement retVal = VariationalRefinement.__fromPtr__(video_VariationalRefinement_create_10());
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. //
  48. // C++: float cv::VariationalRefinement::getAlpha()
  49. //
  50. //javadoc: VariationalRefinement::getAlpha()
  51. public float getAlpha ()
  52. {
  53. ThrowIfDisposed ();
  54. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  55. float retVal = video_VariationalRefinement_getAlpha_10(nativeObj);
  56. return retVal;
  57. #else
  58. return -1;
  59. #endif
  60. }
  61. //
  62. // C++: float cv::VariationalRefinement::getDelta()
  63. //
  64. //javadoc: VariationalRefinement::getDelta()
  65. public float getDelta ()
  66. {
  67. ThrowIfDisposed ();
  68. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  69. float retVal = video_VariationalRefinement_getDelta_10(nativeObj);
  70. return retVal;
  71. #else
  72. return -1;
  73. #endif
  74. }
  75. //
  76. // C++: float cv::VariationalRefinement::getGamma()
  77. //
  78. //javadoc: VariationalRefinement::getGamma()
  79. public float getGamma ()
  80. {
  81. ThrowIfDisposed ();
  82. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  83. float retVal = video_VariationalRefinement_getGamma_10(nativeObj);
  84. return retVal;
  85. #else
  86. return -1;
  87. #endif
  88. }
  89. //
  90. // C++: float cv::VariationalRefinement::getOmega()
  91. //
  92. //javadoc: VariationalRefinement::getOmega()
  93. public float getOmega ()
  94. {
  95. ThrowIfDisposed ();
  96. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  97. float retVal = video_VariationalRefinement_getOmega_10(nativeObj);
  98. return retVal;
  99. #else
  100. return -1;
  101. #endif
  102. }
  103. //
  104. // C++: int cv::VariationalRefinement::getFixedPointIterations()
  105. //
  106. //javadoc: VariationalRefinement::getFixedPointIterations()
  107. public int getFixedPointIterations ()
  108. {
  109. ThrowIfDisposed ();
  110. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  111. int retVal = video_VariationalRefinement_getFixedPointIterations_10(nativeObj);
  112. return retVal;
  113. #else
  114. return -1;
  115. #endif
  116. }
  117. //
  118. // C++: int cv::VariationalRefinement::getSorIterations()
  119. //
  120. //javadoc: VariationalRefinement::getSorIterations()
  121. public int getSorIterations ()
  122. {
  123. ThrowIfDisposed ();
  124. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  125. int retVal = video_VariationalRefinement_getSorIterations_10(nativeObj);
  126. return retVal;
  127. #else
  128. return -1;
  129. #endif
  130. }
  131. //
  132. // C++: void cv::VariationalRefinement::calcUV(Mat I0, Mat I1, Mat& flow_u, Mat& flow_v)
  133. //
  134. //javadoc: VariationalRefinement::calcUV(I0, I1, flow_u, flow_v)
  135. public void calcUV (Mat I0, Mat I1, Mat flow_u, Mat flow_v)
  136. {
  137. ThrowIfDisposed ();
  138. if (I0 != null) I0.ThrowIfDisposed ();
  139. if (I1 != null) I1.ThrowIfDisposed ();
  140. if (flow_u != null) flow_u.ThrowIfDisposed ();
  141. if (flow_v != null) flow_v.ThrowIfDisposed ();
  142. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  143. video_VariationalRefinement_calcUV_10(nativeObj, I0.nativeObj, I1.nativeObj, flow_u.nativeObj, flow_v.nativeObj);
  144. return;
  145. #else
  146. return;
  147. #endif
  148. }
  149. //
  150. // C++: void cv::VariationalRefinement::setAlpha(float val)
  151. //
  152. //javadoc: VariationalRefinement::setAlpha(val)
  153. public void setAlpha (float val)
  154. {
  155. ThrowIfDisposed ();
  156. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  157. video_VariationalRefinement_setAlpha_10(nativeObj, val);
  158. return;
  159. #else
  160. return;
  161. #endif
  162. }
  163. //
  164. // C++: void cv::VariationalRefinement::setDelta(float val)
  165. //
  166. //javadoc: VariationalRefinement::setDelta(val)
  167. public void setDelta (float val)
  168. {
  169. ThrowIfDisposed ();
  170. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  171. video_VariationalRefinement_setDelta_10(nativeObj, val);
  172. return;
  173. #else
  174. return;
  175. #endif
  176. }
  177. //
  178. // C++: void cv::VariationalRefinement::setFixedPointIterations(int val)
  179. //
  180. //javadoc: VariationalRefinement::setFixedPointIterations(val)
  181. public void setFixedPointIterations (int val)
  182. {
  183. ThrowIfDisposed ();
  184. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  185. video_VariationalRefinement_setFixedPointIterations_10(nativeObj, val);
  186. return;
  187. #else
  188. return;
  189. #endif
  190. }
  191. //
  192. // C++: void cv::VariationalRefinement::setGamma(float val)
  193. //
  194. //javadoc: VariationalRefinement::setGamma(val)
  195. public void setGamma (float val)
  196. {
  197. ThrowIfDisposed ();
  198. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  199. video_VariationalRefinement_setGamma_10(nativeObj, val);
  200. return;
  201. #else
  202. return;
  203. #endif
  204. }
  205. //
  206. // C++: void cv::VariationalRefinement::setOmega(float val)
  207. //
  208. //javadoc: VariationalRefinement::setOmega(val)
  209. public void setOmega (float val)
  210. {
  211. ThrowIfDisposed ();
  212. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  213. video_VariationalRefinement_setOmega_10(nativeObj, val);
  214. return;
  215. #else
  216. return;
  217. #endif
  218. }
  219. //
  220. // C++: void cv::VariationalRefinement::setSorIterations(int val)
  221. //
  222. //javadoc: VariationalRefinement::setSorIterations(val)
  223. public void setSorIterations (int val)
  224. {
  225. ThrowIfDisposed ();
  226. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  227. video_VariationalRefinement_setSorIterations_10(nativeObj, val);
  228. return;
  229. #else
  230. return;
  231. #endif
  232. }
  233. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  234. const string LIBNAME = "__Internal";
  235. #else
  236. const string LIBNAME = "opencvforunity";
  237. #endif
  238. // C++: static Ptr_VariationalRefinement cv::VariationalRefinement::create()
  239. [DllImport (LIBNAME)]
  240. private static extern IntPtr video_VariationalRefinement_create_10 ();
  241. // C++: float cv::VariationalRefinement::getAlpha()
  242. [DllImport (LIBNAME)]
  243. private static extern float video_VariationalRefinement_getAlpha_10 (IntPtr nativeObj);
  244. // C++: float cv::VariationalRefinement::getDelta()
  245. [DllImport (LIBNAME)]
  246. private static extern float video_VariationalRefinement_getDelta_10 (IntPtr nativeObj);
  247. // C++: float cv::VariationalRefinement::getGamma()
  248. [DllImport (LIBNAME)]
  249. private static extern float video_VariationalRefinement_getGamma_10 (IntPtr nativeObj);
  250. // C++: float cv::VariationalRefinement::getOmega()
  251. [DllImport (LIBNAME)]
  252. private static extern float video_VariationalRefinement_getOmega_10 (IntPtr nativeObj);
  253. // C++: int cv::VariationalRefinement::getFixedPointIterations()
  254. [DllImport (LIBNAME)]
  255. private static extern int video_VariationalRefinement_getFixedPointIterations_10 (IntPtr nativeObj);
  256. // C++: int cv::VariationalRefinement::getSorIterations()
  257. [DllImport (LIBNAME)]
  258. private static extern int video_VariationalRefinement_getSorIterations_10 (IntPtr nativeObj);
  259. // C++: void cv::VariationalRefinement::calcUV(Mat I0, Mat I1, Mat& flow_u, Mat& flow_v)
  260. [DllImport (LIBNAME)]
  261. private static extern void video_VariationalRefinement_calcUV_10 (IntPtr nativeObj, IntPtr I0_nativeObj, IntPtr I1_nativeObj, IntPtr flow_u_nativeObj, IntPtr flow_v_nativeObj);
  262. // C++: void cv::VariationalRefinement::setAlpha(float val)
  263. [DllImport (LIBNAME)]
  264. private static extern void video_VariationalRefinement_setAlpha_10 (IntPtr nativeObj, float val);
  265. // C++: void cv::VariationalRefinement::setDelta(float val)
  266. [DllImport (LIBNAME)]
  267. private static extern void video_VariationalRefinement_setDelta_10 (IntPtr nativeObj, float val);
  268. // C++: void cv::VariationalRefinement::setFixedPointIterations(int val)
  269. [DllImport (LIBNAME)]
  270. private static extern void video_VariationalRefinement_setFixedPointIterations_10 (IntPtr nativeObj, int val);
  271. // C++: void cv::VariationalRefinement::setGamma(float val)
  272. [DllImport (LIBNAME)]
  273. private static extern void video_VariationalRefinement_setGamma_10 (IntPtr nativeObj, float val);
  274. // C++: void cv::VariationalRefinement::setOmega(float val)
  275. [DllImport (LIBNAME)]
  276. private static extern void video_VariationalRefinement_setOmega_10 (IntPtr nativeObj, float val);
  277. // C++: void cv::VariationalRefinement::setSorIterations(int val)
  278. [DllImport (LIBNAME)]
  279. private static extern void video_VariationalRefinement_setSorIterations_10 (IntPtr nativeObj, int val);
  280. // native support for java finalize()
  281. [DllImport (LIBNAME)]
  282. private static extern void video_VariationalRefinement_delete (IntPtr nativeObj);
  283. }
  284. }