MSDDetector.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.Features2dModule;
  4. using OpenCVForUnity.UtilsModule;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Runtime.InteropServices;
  8. namespace OpenCVForUnity.Xfeatures2dModule {
  9. // C++: class MSDDetector
  10. //javadoc: MSDDetector
  11. public class MSDDetector : Feature2D {
  12. protected override void Dispose(bool disposing) {
  13. #if (UNITY_ANDROID && !UNITY_EDITOR)
  14. try {
  15. if (disposing) {
  16. }
  17. if (IsEnabledDispose) {
  18. if (nativeObj != IntPtr.Zero)
  19. xfeatures2d_MSDDetector_delete(nativeObj);
  20. nativeObj = IntPtr.Zero;
  21. }
  22. } finally {
  23. base.Dispose(disposing);
  24. }
  25. #else
  26. return;
  27. #endif
  28. }
  29. protected internal MSDDetector(IntPtr addr) : base(addr) { }
  30. // internal usage only
  31. public static new MSDDetector __fromPtr__(IntPtr addr) { return new MSDDetector(addr); }
  32. #if (UNITY_ANDROID && !UNITY_EDITOR)
  33. const string LIBNAME = "opencvforunity";
  34. // native support for java finalize()
  35. [DllImport(LIBNAME)]
  36. private static extern void xfeatures2d_MSDDetector_delete(IntPtr nativeObj);
  37. #endif
  38. }
  39. }