Optflow.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461
  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.OptflowModule
  9. {
  10. // C++: class Optflow
  11. //javadoc: Optflow
  12. public class Optflow
  13. {
  14. // C++: enum GPCDescType
  15. public const int GPC_DESCRIPTOR_DCT = 0;
  16. public const int GPC_DESCRIPTOR_WHT = 0 + 1;
  17. //
  18. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_DeepFlow()
  19. //
  20. //javadoc: createOptFlow_DeepFlow()
  21. public static DenseOpticalFlow createOptFlow_DeepFlow ()
  22. {
  23. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  24. DenseOpticalFlow retVal = DenseOpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1DeepFlow_10());
  25. return retVal;
  26. #else
  27. return null;
  28. #endif
  29. }
  30. //
  31. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_Farneback()
  32. //
  33. //javadoc: createOptFlow_Farneback()
  34. public static DenseOpticalFlow createOptFlow_Farneback ()
  35. {
  36. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  37. DenseOpticalFlow retVal = DenseOpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1Farneback_10());
  38. return retVal;
  39. #else
  40. return null;
  41. #endif
  42. }
  43. //
  44. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_PCAFlow()
  45. //
  46. //javadoc: createOptFlow_PCAFlow()
  47. public static DenseOpticalFlow createOptFlow_PCAFlow ()
  48. {
  49. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  50. DenseOpticalFlow retVal = DenseOpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1PCAFlow_10());
  51. return retVal;
  52. #else
  53. return null;
  54. #endif
  55. }
  56. //
  57. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_SimpleFlow()
  58. //
  59. //javadoc: createOptFlow_SimpleFlow()
  60. public static DenseOpticalFlow createOptFlow_SimpleFlow ()
  61. {
  62. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  63. DenseOpticalFlow retVal = DenseOpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1SimpleFlow_10());
  64. return retVal;
  65. #else
  66. return null;
  67. #endif
  68. }
  69. //
  70. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_SparseToDense()
  71. //
  72. //javadoc: createOptFlow_SparseToDense()
  73. public static DenseOpticalFlow createOptFlow_SparseToDense ()
  74. {
  75. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  76. DenseOpticalFlow retVal = DenseOpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1SparseToDense_10());
  77. return retVal;
  78. #else
  79. return null;
  80. #endif
  81. }
  82. //
  83. // C++: Ptr_DualTVL1OpticalFlow cv::optflow::createOptFlow_DualTVL1()
  84. //
  85. //javadoc: createOptFlow_DualTVL1()
  86. public static DualTVL1OpticalFlow createOptFlow_DualTVL1 ()
  87. {
  88. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  89. DualTVL1OpticalFlow retVal = DualTVL1OpticalFlow.__fromPtr__(optflow_Optflow_createOptFlow_1DualTVL1_10());
  90. return retVal;
  91. #else
  92. return null;
  93. #endif
  94. }
  95. //
  96. // C++: double cv::motempl::calcGlobalOrientation(Mat orientation, Mat mask, Mat mhi, double timestamp, double duration)
  97. //
  98. //javadoc: calcGlobalOrientation(orientation, mask, mhi, timestamp, duration)
  99. public static double calcGlobalOrientation (Mat orientation, Mat mask, Mat mhi, double timestamp, double duration)
  100. {
  101. if (orientation != null) orientation.ThrowIfDisposed ();
  102. if (mask != null) mask.ThrowIfDisposed ();
  103. if (mhi != null) mhi.ThrowIfDisposed ();
  104. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  105. double retVal = optflow_Optflow_calcGlobalOrientation_10(orientation.nativeObj, mask.nativeObj, mhi.nativeObj, timestamp, duration);
  106. return retVal;
  107. #else
  108. return -1;
  109. #endif
  110. }
  111. //
  112. // C++: void cv::motempl::calcMotionGradient(Mat mhi, Mat& mask, Mat& orientation, double delta1, double delta2, int apertureSize = 3)
  113. //
  114. //javadoc: calcMotionGradient(mhi, mask, orientation, delta1, delta2, apertureSize)
  115. public static void calcMotionGradient (Mat mhi, Mat mask, Mat orientation, double delta1, double delta2, int apertureSize)
  116. {
  117. if (mhi != null) mhi.ThrowIfDisposed ();
  118. if (mask != null) mask.ThrowIfDisposed ();
  119. if (orientation != null) orientation.ThrowIfDisposed ();
  120. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  121. optflow_Optflow_calcMotionGradient_10(mhi.nativeObj, mask.nativeObj, orientation.nativeObj, delta1, delta2, apertureSize);
  122. return;
  123. #else
  124. return;
  125. #endif
  126. }
  127. //javadoc: calcMotionGradient(mhi, mask, orientation, delta1, delta2)
  128. public static void calcMotionGradient (Mat mhi, Mat mask, Mat orientation, double delta1, double delta2)
  129. {
  130. if (mhi != null) mhi.ThrowIfDisposed ();
  131. if (mask != null) mask.ThrowIfDisposed ();
  132. if (orientation != null) orientation.ThrowIfDisposed ();
  133. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  134. optflow_Optflow_calcMotionGradient_11(mhi.nativeObj, mask.nativeObj, orientation.nativeObj, delta1, delta2);
  135. return;
  136. #else
  137. return;
  138. #endif
  139. }
  140. //
  141. // C++: void cv::motempl::segmentMotion(Mat mhi, Mat& segmask, vector_Rect& boundingRects, double timestamp, double segThresh)
  142. //
  143. //javadoc: segmentMotion(mhi, segmask, boundingRects, timestamp, segThresh)
  144. public static void segmentMotion (Mat mhi, Mat segmask, MatOfRect boundingRects, double timestamp, double segThresh)
  145. {
  146. if (mhi != null) mhi.ThrowIfDisposed ();
  147. if (segmask != null) segmask.ThrowIfDisposed ();
  148. if (boundingRects != null) boundingRects.ThrowIfDisposed ();
  149. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  150. Mat boundingRects_mat = boundingRects;
  151. optflow_Optflow_segmentMotion_10(mhi.nativeObj, segmask.nativeObj, boundingRects_mat.nativeObj, timestamp, segThresh);
  152. return;
  153. #else
  154. return;
  155. #endif
  156. }
  157. //
  158. // C++: void cv::motempl::updateMotionHistory(Mat silhouette, Mat& mhi, double timestamp, double duration)
  159. //
  160. //javadoc: updateMotionHistory(silhouette, mhi, timestamp, duration)
  161. public static void updateMotionHistory (Mat silhouette, Mat mhi, double timestamp, double duration)
  162. {
  163. if (silhouette != null) silhouette.ThrowIfDisposed ();
  164. if (mhi != null) mhi.ThrowIfDisposed ();
  165. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  166. optflow_Optflow_updateMotionHistory_10(silhouette.nativeObj, mhi.nativeObj, timestamp, duration);
  167. return;
  168. #else
  169. return;
  170. #endif
  171. }
  172. //
  173. // C++: void cv::optflow::calcOpticalFlowSF(Mat from, Mat to, Mat& flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr)
  174. //
  175. //javadoc: calcOpticalFlowSF(from, to, flow, layers, averaging_block_size, max_flow, sigma_dist, sigma_color, postprocess_window, sigma_dist_fix, sigma_color_fix, occ_thr, upscale_averaging_radius, upscale_sigma_dist, upscale_sigma_color, speed_up_thr)
  176. public static void calcOpticalFlowSF (Mat from, Mat to, Mat flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr)
  177. {
  178. if (from != null) from.ThrowIfDisposed ();
  179. if (to != null) to.ThrowIfDisposed ();
  180. if (flow != null) flow.ThrowIfDisposed ();
  181. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  182. optflow_Optflow_calcOpticalFlowSF_10(from.nativeObj, to.nativeObj, flow.nativeObj, layers, averaging_block_size, max_flow, sigma_dist, sigma_color, postprocess_window, sigma_dist_fix, sigma_color_fix, occ_thr, upscale_averaging_radius, upscale_sigma_dist, upscale_sigma_color, speed_up_thr);
  183. return;
  184. #else
  185. return;
  186. #endif
  187. }
  188. //
  189. // C++: void cv::optflow::calcOpticalFlowSF(Mat from, Mat to, Mat& flow, int layers, int averaging_block_size, int max_flow)
  190. //
  191. //javadoc: calcOpticalFlowSF(from, to, flow, layers, averaging_block_size, max_flow)
  192. public static void calcOpticalFlowSF (Mat from, Mat to, Mat flow, int layers, int averaging_block_size, int max_flow)
  193. {
  194. if (from != null) from.ThrowIfDisposed ();
  195. if (to != null) to.ThrowIfDisposed ();
  196. if (flow != null) flow.ThrowIfDisposed ();
  197. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  198. optflow_Optflow_calcOpticalFlowSF_11(from.nativeObj, to.nativeObj, flow.nativeObj, layers, averaging_block_size, max_flow);
  199. return;
  200. #else
  201. return;
  202. #endif
  203. }
  204. //
  205. // C++: void cv::optflow::calcOpticalFlowSparseToDense(Mat from, Mat to, Mat& flow, int grid_step = 8, int k = 128, float sigma = 0.05f, bool use_post_proc = true, float fgs_lambda = 500.0f, float fgs_sigma = 1.5f)
  206. //
  207. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step, k, sigma, use_post_proc, fgs_lambda, fgs_sigma)
  208. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step, int k, float sigma, bool use_post_proc, float fgs_lambda, float fgs_sigma)
  209. {
  210. if (from != null) from.ThrowIfDisposed ();
  211. if (to != null) to.ThrowIfDisposed ();
  212. if (flow != null) flow.ThrowIfDisposed ();
  213. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  214. optflow_Optflow_calcOpticalFlowSparseToDense_10(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step, k, sigma, use_post_proc, fgs_lambda, fgs_sigma);
  215. return;
  216. #else
  217. return;
  218. #endif
  219. }
  220. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step, k, sigma, use_post_proc, fgs_lambda)
  221. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step, int k, float sigma, bool use_post_proc, float fgs_lambda)
  222. {
  223. if (from != null) from.ThrowIfDisposed ();
  224. if (to != null) to.ThrowIfDisposed ();
  225. if (flow != null) flow.ThrowIfDisposed ();
  226. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  227. optflow_Optflow_calcOpticalFlowSparseToDense_11(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step, k, sigma, use_post_proc, fgs_lambda);
  228. return;
  229. #else
  230. return;
  231. #endif
  232. }
  233. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step, k, sigma, use_post_proc)
  234. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step, int k, float sigma, bool use_post_proc)
  235. {
  236. if (from != null) from.ThrowIfDisposed ();
  237. if (to != null) to.ThrowIfDisposed ();
  238. if (flow != null) flow.ThrowIfDisposed ();
  239. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  240. optflow_Optflow_calcOpticalFlowSparseToDense_12(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step, k, sigma, use_post_proc);
  241. return;
  242. #else
  243. return;
  244. #endif
  245. }
  246. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step, k, sigma)
  247. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step, int k, float sigma)
  248. {
  249. if (from != null) from.ThrowIfDisposed ();
  250. if (to != null) to.ThrowIfDisposed ();
  251. if (flow != null) flow.ThrowIfDisposed ();
  252. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  253. optflow_Optflow_calcOpticalFlowSparseToDense_13(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step, k, sigma);
  254. return;
  255. #else
  256. return;
  257. #endif
  258. }
  259. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step, k)
  260. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step, int k)
  261. {
  262. if (from != null) from.ThrowIfDisposed ();
  263. if (to != null) to.ThrowIfDisposed ();
  264. if (flow != null) flow.ThrowIfDisposed ();
  265. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  266. optflow_Optflow_calcOpticalFlowSparseToDense_14(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step, k);
  267. return;
  268. #else
  269. return;
  270. #endif
  271. }
  272. //javadoc: calcOpticalFlowSparseToDense(from, to, flow, grid_step)
  273. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow, int grid_step)
  274. {
  275. if (from != null) from.ThrowIfDisposed ();
  276. if (to != null) to.ThrowIfDisposed ();
  277. if (flow != null) flow.ThrowIfDisposed ();
  278. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  279. optflow_Optflow_calcOpticalFlowSparseToDense_15(from.nativeObj, to.nativeObj, flow.nativeObj, grid_step);
  280. return;
  281. #else
  282. return;
  283. #endif
  284. }
  285. //javadoc: calcOpticalFlowSparseToDense(from, to, flow)
  286. public static void calcOpticalFlowSparseToDense (Mat from, Mat to, Mat flow)
  287. {
  288. if (from != null) from.ThrowIfDisposed ();
  289. if (to != null) to.ThrowIfDisposed ();
  290. if (flow != null) flow.ThrowIfDisposed ();
  291. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  292. optflow_Optflow_calcOpticalFlowSparseToDense_16(from.nativeObj, to.nativeObj, flow.nativeObj);
  293. return;
  294. #else
  295. return;
  296. #endif
  297. }
  298. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  299. const string LIBNAME = "__Internal";
  300. #else
  301. const string LIBNAME = "opencvforunity";
  302. #endif
  303. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_DeepFlow()
  304. [DllImport (LIBNAME)]
  305. private static extern IntPtr optflow_Optflow_createOptFlow_1DeepFlow_10 ();
  306. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_Farneback()
  307. [DllImport (LIBNAME)]
  308. private static extern IntPtr optflow_Optflow_createOptFlow_1Farneback_10 ();
  309. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_PCAFlow()
  310. [DllImport (LIBNAME)]
  311. private static extern IntPtr optflow_Optflow_createOptFlow_1PCAFlow_10 ();
  312. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_SimpleFlow()
  313. [DllImport (LIBNAME)]
  314. private static extern IntPtr optflow_Optflow_createOptFlow_1SimpleFlow_10 ();
  315. // C++: Ptr_DenseOpticalFlow cv::optflow::createOptFlow_SparseToDense()
  316. [DllImport (LIBNAME)]
  317. private static extern IntPtr optflow_Optflow_createOptFlow_1SparseToDense_10 ();
  318. // C++: Ptr_DualTVL1OpticalFlow cv::optflow::createOptFlow_DualTVL1()
  319. [DllImport (LIBNAME)]
  320. private static extern IntPtr optflow_Optflow_createOptFlow_1DualTVL1_10 ();
  321. // C++: double cv::motempl::calcGlobalOrientation(Mat orientation, Mat mask, Mat mhi, double timestamp, double duration)
  322. [DllImport (LIBNAME)]
  323. private static extern double optflow_Optflow_calcGlobalOrientation_10 (IntPtr orientation_nativeObj, IntPtr mask_nativeObj, IntPtr mhi_nativeObj, double timestamp, double duration);
  324. // C++: void cv::motempl::calcMotionGradient(Mat mhi, Mat& mask, Mat& orientation, double delta1, double delta2, int apertureSize = 3)
  325. [DllImport (LIBNAME)]
  326. private static extern void optflow_Optflow_calcMotionGradient_10 (IntPtr mhi_nativeObj, IntPtr mask_nativeObj, IntPtr orientation_nativeObj, double delta1, double delta2, int apertureSize);
  327. [DllImport (LIBNAME)]
  328. private static extern void optflow_Optflow_calcMotionGradient_11 (IntPtr mhi_nativeObj, IntPtr mask_nativeObj, IntPtr orientation_nativeObj, double delta1, double delta2);
  329. // C++: void cv::motempl::segmentMotion(Mat mhi, Mat& segmask, vector_Rect& boundingRects, double timestamp, double segThresh)
  330. [DllImport (LIBNAME)]
  331. private static extern void optflow_Optflow_segmentMotion_10 (IntPtr mhi_nativeObj, IntPtr segmask_nativeObj, IntPtr boundingRects_mat_nativeObj, double timestamp, double segThresh);
  332. // C++: void cv::motempl::updateMotionHistory(Mat silhouette, Mat& mhi, double timestamp, double duration)
  333. [DllImport (LIBNAME)]
  334. private static extern void optflow_Optflow_updateMotionHistory_10 (IntPtr silhouette_nativeObj, IntPtr mhi_nativeObj, double timestamp, double duration);
  335. // C++: void cv::optflow::calcOpticalFlowSF(Mat from, Mat to, Mat& flow, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr)
  336. [DllImport (LIBNAME)]
  337. private static extern void optflow_Optflow_calcOpticalFlowSF_10 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int layers, int averaging_block_size, int max_flow, double sigma_dist, double sigma_color, int postprocess_window, double sigma_dist_fix, double sigma_color_fix, double occ_thr, int upscale_averaging_radius, double upscale_sigma_dist, double upscale_sigma_color, double speed_up_thr);
  338. // C++: void cv::optflow::calcOpticalFlowSF(Mat from, Mat to, Mat& flow, int layers, int averaging_block_size, int max_flow)
  339. [DllImport (LIBNAME)]
  340. private static extern void optflow_Optflow_calcOpticalFlowSF_11 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int layers, int averaging_block_size, int max_flow);
  341. // C++: void cv::optflow::calcOpticalFlowSparseToDense(Mat from, Mat to, Mat& flow, int grid_step = 8, int k = 128, float sigma = 0.05f, bool use_post_proc = true, float fgs_lambda = 500.0f, float fgs_sigma = 1.5f)
  342. [DllImport (LIBNAME)]
  343. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_10 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step, int k, float sigma, bool use_post_proc, float fgs_lambda, float fgs_sigma);
  344. [DllImport (LIBNAME)]
  345. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_11 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step, int k, float sigma, bool use_post_proc, float fgs_lambda);
  346. [DllImport (LIBNAME)]
  347. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_12 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step, int k, float sigma, bool use_post_proc);
  348. [DllImport (LIBNAME)]
  349. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_13 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step, int k, float sigma);
  350. [DllImport (LIBNAME)]
  351. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_14 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step, int k);
  352. [DllImport (LIBNAME)]
  353. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_15 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj, int grid_step);
  354. [DllImport (LIBNAME)]
  355. private static extern void optflow_Optflow_calcOpticalFlowSparseToDense_16 (IntPtr from_nativeObj, IntPtr to_nativeObj, IntPtr flow_nativeObj);
  356. }
  357. }