FlannBasedMatcher.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.Features2dModule
  8. {
  9. // C++: class FlannBasedMatcher
  10. //javadoc: FlannBasedMatcher
  11. public class FlannBasedMatcher : DescriptorMatcher
  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. features2d_FlannBasedMatcher_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal FlannBasedMatcher (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new FlannBasedMatcher __fromPtr__ (IntPtr addr) { return new FlannBasedMatcher (addr); }
  34. //
  35. // C++: cv::FlannBasedMatcher::FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr<flann::KDTreeIndexParams>(), Ptr_flann_SearchParams searchParams = makePtr<flann::SearchParams>())
  36. //
  37. //javadoc: FlannBasedMatcher::FlannBasedMatcher()
  38. public FlannBasedMatcher () :
  39. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  40. base( features2d_FlannBasedMatcher_FlannBasedMatcher_10() )
  41. #else
  42. base (IntPtr.Zero)
  43. #endif
  44. {
  45. return;
  46. }
  47. //
  48. // C++: static Ptr_FlannBasedMatcher cv::FlannBasedMatcher::create()
  49. //
  50. //javadoc: FlannBasedMatcher::create()
  51. public static FlannBasedMatcher create ()
  52. {
  53. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  54. FlannBasedMatcher retVal = FlannBasedMatcher.__fromPtr__(features2d_FlannBasedMatcher_create_10());
  55. return retVal;
  56. #else
  57. return null;
  58. #endif
  59. }
  60. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  61. const string LIBNAME = "__Internal";
  62. #else
  63. const string LIBNAME = "opencvforunity";
  64. #endif
  65. // C++: cv::FlannBasedMatcher::FlannBasedMatcher(Ptr_flann_IndexParams indexParams = makePtr<flann::KDTreeIndexParams>(), Ptr_flann_SearchParams searchParams = makePtr<flann::SearchParams>())
  66. [DllImport (LIBNAME)]
  67. private static extern IntPtr features2d_FlannBasedMatcher_FlannBasedMatcher_10 ();
  68. // C++: static Ptr_FlannBasedMatcher cv::FlannBasedMatcher::create()
  69. [DllImport (LIBNAME)]
  70. private static extern IntPtr features2d_FlannBasedMatcher_create_10 ();
  71. // native support for java finalize()
  72. [DllImport (LIBNAME)]
  73. private static extern void features2d_FlannBasedMatcher_delete (IntPtr nativeObj);
  74. }
  75. }