TrackerMedianFlow.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.TrackingModule
  8. {
  9. // C++: class TrackerMedianFlow
  10. //javadoc: TrackerMedianFlow
  11. public class TrackerMedianFlow : Tracker
  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. tracking_TrackerMedianFlow_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal TrackerMedianFlow (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new TrackerMedianFlow __fromPtr__ (IntPtr addr) { return new TrackerMedianFlow (addr); }
  34. //
  35. // C++: static Ptr_TrackerMedianFlow cv::TrackerMedianFlow::create()
  36. //
  37. //javadoc: TrackerMedianFlow::create()
  38. public static TrackerMedianFlow create ()
  39. {
  40. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  41. TrackerMedianFlow retVal = TrackerMedianFlow.__fromPtr__(tracking_TrackerMedianFlow_create_10());
  42. return retVal;
  43. #else
  44. return null;
  45. #endif
  46. }
  47. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  48. const string LIBNAME = "__Internal";
  49. #else
  50. const string LIBNAME = "opencvforunity";
  51. #endif
  52. // C++: static Ptr_TrackerMedianFlow cv::TrackerMedianFlow::create()
  53. [DllImport (LIBNAME)]
  54. private static extern IntPtr tracking_TrackerMedianFlow_create_10 ();
  55. // native support for java finalize()
  56. [DllImport (LIBNAME)]
  57. private static extern void tracking_TrackerMedianFlow_delete (IntPtr nativeObj);
  58. }
  59. }