BaseCascadeClassifier.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.ObjdetectModule {
  8. // C++: class BaseCascadeClassifier
  9. //javadoc: BaseCascadeClassifier
  10. public class BaseCascadeClassifier : Algorithm {
  11. protected override void Dispose(bool disposing) {
  12. #if (UNITY_ANDROID && !UNITY_EDITOR)
  13. try {
  14. if (disposing) {
  15. }
  16. if (IsEnabledDispose) {
  17. if (nativeObj != IntPtr.Zero)
  18. objdetect_BaseCascadeClassifier_delete(nativeObj);
  19. nativeObj = IntPtr.Zero;
  20. }
  21. } finally {
  22. base.Dispose(disposing);
  23. }
  24. #else
  25. return;
  26. #endif
  27. }
  28. protected internal BaseCascadeClassifier(IntPtr addr) : base(addr) { }
  29. // internal usage only
  30. public static new BaseCascadeClassifier __fromPtr__(IntPtr addr) { return new BaseCascadeClassifier(addr); }
  31. const string LIBNAME = "opencvforunity";
  32. #if (UNITY_ANDROID && !UNITY_EDITOR)
  33. // native support for java finalize()
  34. [DllImport(LIBNAME)]
  35. private static extern void objdetect_BaseCascadeClassifier_delete(IntPtr nativeObj);
  36. #endif
  37. }
  38. }