StarDetector.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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 StarDetector
  11. //javadoc: StarDetector
  12. public class StarDetector : 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_StarDetector_delete(nativeObj);
  23. nativeObj = IntPtr.Zero;
  24. }
  25. } finally {
  26. base.Dispose (disposing);
  27. }
  28. #else
  29. return;
  30. #endif
  31. }
  32. protected internal StarDetector (IntPtr addr) : base (addr) { }
  33. // internal usage only
  34. public static new StarDetector __fromPtr__ (IntPtr addr) { return new StarDetector (addr); }
  35. //
  36. // C++: static Ptr_StarDetector cv::xfeatures2d::StarDetector::create(int maxSize = 45, int responseThreshold = 30, int lineThresholdProjected = 10, int lineThresholdBinarized = 8, int suppressNonmaxSize = 5)
  37. //
  38. //javadoc: StarDetector::create(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized, suppressNonmaxSize)
  39. public static StarDetector create (int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize)
  40. {
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_10(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized, suppressNonmaxSize));
  43. return retVal;
  44. #else
  45. return null;
  46. #endif
  47. }
  48. //javadoc: StarDetector::create(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized)
  49. public static StarDetector create (int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized)
  50. {
  51. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  52. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_11(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized));
  53. return retVal;
  54. #else
  55. return null;
  56. #endif
  57. }
  58. //javadoc: StarDetector::create(maxSize, responseThreshold, lineThresholdProjected)
  59. public static StarDetector create (int maxSize, int responseThreshold, int lineThresholdProjected)
  60. {
  61. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  62. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_12(maxSize, responseThreshold, lineThresholdProjected));
  63. return retVal;
  64. #else
  65. return null;
  66. #endif
  67. }
  68. //javadoc: StarDetector::create(maxSize, responseThreshold)
  69. public static StarDetector create (int maxSize, int responseThreshold)
  70. {
  71. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  72. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_13(maxSize, responseThreshold));
  73. return retVal;
  74. #else
  75. return null;
  76. #endif
  77. }
  78. //javadoc: StarDetector::create(maxSize)
  79. public static StarDetector create (int maxSize)
  80. {
  81. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  82. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_14(maxSize));
  83. return retVal;
  84. #else
  85. return null;
  86. #endif
  87. }
  88. //javadoc: StarDetector::create()
  89. public static StarDetector create ()
  90. {
  91. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  92. StarDetector retVal = StarDetector.__fromPtr__(xfeatures2d_StarDetector_create_15());
  93. return retVal;
  94. #else
  95. return null;
  96. #endif
  97. }
  98. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  99. const string LIBNAME = "__Internal";
  100. #else
  101. const string LIBNAME = "opencvforunity";
  102. #endif
  103. // C++: static Ptr_StarDetector cv::xfeatures2d::StarDetector::create(int maxSize = 45, int responseThreshold = 30, int lineThresholdProjected = 10, int lineThresholdBinarized = 8, int suppressNonmaxSize = 5)
  104. [DllImport (LIBNAME)]
  105. private static extern IntPtr xfeatures2d_StarDetector_create_10 (int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize);
  106. [DllImport (LIBNAME)]
  107. private static extern IntPtr xfeatures2d_StarDetector_create_11 (int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized);
  108. [DllImport (LIBNAME)]
  109. private static extern IntPtr xfeatures2d_StarDetector_create_12 (int maxSize, int responseThreshold, int lineThresholdProjected);
  110. [DllImport (LIBNAME)]
  111. private static extern IntPtr xfeatures2d_StarDetector_create_13 (int maxSize, int responseThreshold);
  112. [DllImport (LIBNAME)]
  113. private static extern IntPtr xfeatures2d_StarDetector_create_14 (int maxSize);
  114. [DllImport (LIBNAME)]
  115. private static extern IntPtr xfeatures2d_StarDetector_create_15 ();
  116. // native support for java finalize()
  117. [DllImport (LIBNAME)]
  118. private static extern void xfeatures2d_StarDetector_delete (IntPtr nativeObj);
  119. }
  120. }