DAISY.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. {
  10. // C++: class DAISY
  11. //javadoc: DAISY
  12. public class DAISY : Feature2D
  13. {
  14. protected override void Dispose (bool disposing)
  15. {
  16. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  17. try {
  18. if (disposing) {
  19. }
  20. if (IsEnabledDispose) {
  21. if (nativeObj != IntPtr.Zero)
  22. xfeatures2d_DAISY_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal DAISY (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new DAISY __fromPtr__ (IntPtr addr) { return new DAISY (addr); }
  35. // C++: enum NormalizationType
  36. public const int NRM_NONE = 100;
  37. public const int NRM_PARTIAL = 101;
  38. public const int NRM_FULL = 102;
  39. public const int NRM_SIFT = 103;
  40. //
  41. // C++: static Ptr_DAISY cv::xfeatures2d::DAISY::create(float radius = 15, int q_radius = 3, int q_theta = 8, int q_hist = 8, DAISY_NormalizationType norm = DAISY::NRM_NONE, Mat H = Mat(), bool interpolation = true, bool use_orientation = false)
  42. //
  43. //javadoc: DAISY::create(radius, q_radius, q_theta, q_hist, H, interpolation, use_orientation)
  44. public static DAISY create (float radius, int q_radius, int q_theta, int q_hist, Mat H, bool interpolation, bool use_orientation)
  45. {
  46. if (H != null) H.ThrowIfDisposed ();
  47. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  48. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_10(radius, q_radius, q_theta, q_hist, H.nativeObj, interpolation, use_orientation));
  49. return retVal;
  50. #else
  51. return null;
  52. #endif
  53. }
  54. //javadoc: DAISY::create(radius, q_radius, q_theta, q_hist, H, interpolation)
  55. public static DAISY create (float radius, int q_radius, int q_theta, int q_hist, Mat H, bool interpolation)
  56. {
  57. if (H != null) H.ThrowIfDisposed ();
  58. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  59. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_11(radius, q_radius, q_theta, q_hist, H.nativeObj, interpolation));
  60. return retVal;
  61. #else
  62. return null;
  63. #endif
  64. }
  65. //javadoc: DAISY::create(radius, q_radius, q_theta, q_hist, H)
  66. public static DAISY create (float radius, int q_radius, int q_theta, int q_hist, Mat H)
  67. {
  68. if (H != null) H.ThrowIfDisposed ();
  69. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  70. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_12(radius, q_radius, q_theta, q_hist, H.nativeObj));
  71. return retVal;
  72. #else
  73. return null;
  74. #endif
  75. }
  76. //javadoc: DAISY::create(radius, q_radius, q_theta, q_hist)
  77. public static DAISY create (float radius, int q_radius, int q_theta, int q_hist)
  78. {
  79. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  80. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_13(radius, q_radius, q_theta, q_hist));
  81. return retVal;
  82. #else
  83. return null;
  84. #endif
  85. }
  86. //javadoc: DAISY::create(radius, q_radius, q_theta)
  87. public static DAISY create (float radius, int q_radius, int q_theta)
  88. {
  89. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  90. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_15(radius, q_radius, q_theta));
  91. return retVal;
  92. #else
  93. return null;
  94. #endif
  95. }
  96. //javadoc: DAISY::create(radius, q_radius)
  97. public static DAISY create (float radius, int q_radius)
  98. {
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_16(radius, q_radius));
  101. return retVal;
  102. #else
  103. return null;
  104. #endif
  105. }
  106. //javadoc: DAISY::create(radius)
  107. public static DAISY create (float radius)
  108. {
  109. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  110. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_17(radius));
  111. return retVal;
  112. #else
  113. return null;
  114. #endif
  115. }
  116. //javadoc: DAISY::create()
  117. public static DAISY create ()
  118. {
  119. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  120. DAISY retVal = DAISY.__fromPtr__(xfeatures2d_DAISY_create_18());
  121. return retVal;
  122. #else
  123. return null;
  124. #endif
  125. }
  126. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  127. const string LIBNAME = "__Internal";
  128. #else
  129. const string LIBNAME = "opencvforunity";
  130. #endif
  131. // C++: static Ptr_DAISY cv::xfeatures2d::DAISY::create(float radius = 15, int q_radius = 3, int q_theta = 8, int q_hist = 8, DAISY_NormalizationType norm = DAISY::NRM_NONE, Mat H = Mat(), bool interpolation = true, bool use_orientation = false)
  132. [DllImport (LIBNAME)]
  133. private static extern IntPtr xfeatures2d_DAISY_create_10 (float radius, int q_radius, int q_theta, int q_hist, IntPtr H_nativeObj, bool interpolation, bool use_orientation);
  134. [DllImport (LIBNAME)]
  135. private static extern IntPtr xfeatures2d_DAISY_create_11 (float radius, int q_radius, int q_theta, int q_hist, IntPtr H_nativeObj, bool interpolation);
  136. [DllImport (LIBNAME)]
  137. private static extern IntPtr xfeatures2d_DAISY_create_12 (float radius, int q_radius, int q_theta, int q_hist, IntPtr H_nativeObj);
  138. [DllImport (LIBNAME)]
  139. private static extern IntPtr xfeatures2d_DAISY_create_13 (float radius, int q_radius, int q_theta, int q_hist);
  140. [DllImport (LIBNAME)]
  141. private static extern IntPtr xfeatures2d_DAISY_create_15 (float radius, int q_radius, int q_theta);
  142. [DllImport (LIBNAME)]
  143. private static extern IntPtr xfeatures2d_DAISY_create_16 (float radius, int q_radius);
  144. [DllImport (LIBNAME)]
  145. private static extern IntPtr xfeatures2d_DAISY_create_17 (float radius);
  146. [DllImport (LIBNAME)]
  147. private static extern IntPtr xfeatures2d_DAISY_create_18 ();
  148. // native support for java finalize()
  149. [DllImport (LIBNAME)]
  150. private static extern void xfeatures2d_DAISY_delete (IntPtr nativeObj);
  151. }
  152. }