legacy_TrackerBoosting.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.TrackingModule
  7. {
  8. // C++: class TrackerBoosting
  9. /**
  10. * the Boosting tracker
  11. *
  12. * This is a real-time object tracking based on a novel on-line version of the AdaBoost algorithm.
  13. * The classifier uses the surrounding background as negative examples in update step to avoid the
  14. * drifting problem. The implementation is based on CITE: OLB .
  15. */
  16. public class legacy_TrackerBoosting : legacy_Tracker
  17. {
  18. protected override void Dispose(bool disposing)
  19. {
  20. try
  21. {
  22. if (disposing)
  23. {
  24. }
  25. if (IsEnabledDispose)
  26. {
  27. if (nativeObj != IntPtr.Zero)
  28. tracking_legacy_1TrackerBoosting_delete(nativeObj);
  29. nativeObj = IntPtr.Zero;
  30. }
  31. }
  32. finally
  33. {
  34. base.Dispose(disposing);
  35. }
  36. }
  37. protected internal legacy_TrackerBoosting(IntPtr addr) : base(addr) { }
  38. // internal usage only
  39. public static new legacy_TrackerBoosting __fromPtr__(IntPtr addr) { return new legacy_TrackerBoosting(addr); }
  40. //
  41. // C++: static Ptr_legacy_TrackerBoosting cv::legacy::TrackerBoosting::create()
  42. //
  43. /**
  44. * Constructor
  45. * return automatically generated
  46. */
  47. public static legacy_TrackerBoosting create()
  48. {
  49. return legacy_TrackerBoosting.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(tracking_legacy_1TrackerBoosting_create_10()));
  50. }
  51. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  52. const string LIBNAME = "__Internal";
  53. #else
  54. const string LIBNAME = "opencvforunity";
  55. #endif
  56. // C++: static Ptr_legacy_TrackerBoosting cv::legacy::TrackerBoosting::create()
  57. [DllImport(LIBNAME)]
  58. private static extern IntPtr tracking_legacy_1TrackerBoosting_create_10();
  59. // native support for java finalize()
  60. [DllImport(LIBNAME)]
  61. private static extern void tracking_legacy_1TrackerBoosting_delete(IntPtr nativeObj);
  62. }
  63. }