StarDetector.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.Features2dModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.Xfeatures2dModule
  8. {
  9. // C++: class StarDetector
  10. /**
  11. * The class implements the keypoint detector introduced by CITE: Agrawal08, synonym of StarDetector. :
  12. */
  13. public class StarDetector : Feature2D
  14. {
  15. protected override void Dispose(bool disposing)
  16. {
  17. try
  18. {
  19. if (disposing)
  20. {
  21. }
  22. if (IsEnabledDispose)
  23. {
  24. if (nativeObj != IntPtr.Zero)
  25. xfeatures2d_StarDetector_delete(nativeObj);
  26. nativeObj = IntPtr.Zero;
  27. }
  28. }
  29. finally
  30. {
  31. base.Dispose(disposing);
  32. }
  33. }
  34. protected internal StarDetector(IntPtr addr) : base(addr) { }
  35. // internal usage only
  36. public static new StarDetector __fromPtr__(IntPtr addr) { return new StarDetector(addr); }
  37. //
  38. // C++: static Ptr_StarDetector cv::xfeatures2d::StarDetector::create(int maxSize = 45, int responseThreshold = 30, int lineThresholdProjected = 10, int lineThresholdBinarized = 8, int suppressNonmaxSize = 5)
  39. //
  40. public static StarDetector create(int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize)
  41. {
  42. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_10(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized, suppressNonmaxSize)));
  43. }
  44. public static StarDetector create(int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized)
  45. {
  46. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_11(maxSize, responseThreshold, lineThresholdProjected, lineThresholdBinarized)));
  47. }
  48. public static StarDetector create(int maxSize, int responseThreshold, int lineThresholdProjected)
  49. {
  50. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_12(maxSize, responseThreshold, lineThresholdProjected)));
  51. }
  52. public static StarDetector create(int maxSize, int responseThreshold)
  53. {
  54. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_13(maxSize, responseThreshold)));
  55. }
  56. public static StarDetector create(int maxSize)
  57. {
  58. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_14(maxSize)));
  59. }
  60. public static StarDetector create()
  61. {
  62. return StarDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_create_15()));
  63. }
  64. //
  65. // C++: void cv::xfeatures2d::StarDetector::setMaxSize(int _maxSize)
  66. //
  67. public void setMaxSize(int _maxSize)
  68. {
  69. ThrowIfDisposed();
  70. xfeatures2d_StarDetector_setMaxSize_10(nativeObj, _maxSize);
  71. }
  72. //
  73. // C++: int cv::xfeatures2d::StarDetector::getMaxSize()
  74. //
  75. public int getMaxSize()
  76. {
  77. ThrowIfDisposed();
  78. return xfeatures2d_StarDetector_getMaxSize_10(nativeObj);
  79. }
  80. //
  81. // C++: void cv::xfeatures2d::StarDetector::setResponseThreshold(int _responseThreshold)
  82. //
  83. public void setResponseThreshold(int _responseThreshold)
  84. {
  85. ThrowIfDisposed();
  86. xfeatures2d_StarDetector_setResponseThreshold_10(nativeObj, _responseThreshold);
  87. }
  88. //
  89. // C++: int cv::xfeatures2d::StarDetector::getResponseThreshold()
  90. //
  91. public int getResponseThreshold()
  92. {
  93. ThrowIfDisposed();
  94. return xfeatures2d_StarDetector_getResponseThreshold_10(nativeObj);
  95. }
  96. //
  97. // C++: void cv::xfeatures2d::StarDetector::setLineThresholdProjected(int _lineThresholdProjected)
  98. //
  99. public void setLineThresholdProjected(int _lineThresholdProjected)
  100. {
  101. ThrowIfDisposed();
  102. xfeatures2d_StarDetector_setLineThresholdProjected_10(nativeObj, _lineThresholdProjected);
  103. }
  104. //
  105. // C++: int cv::xfeatures2d::StarDetector::getLineThresholdProjected()
  106. //
  107. public int getLineThresholdProjected()
  108. {
  109. ThrowIfDisposed();
  110. return xfeatures2d_StarDetector_getLineThresholdProjected_10(nativeObj);
  111. }
  112. //
  113. // C++: void cv::xfeatures2d::StarDetector::setLineThresholdBinarized(int _lineThresholdBinarized)
  114. //
  115. public void setLineThresholdBinarized(int _lineThresholdBinarized)
  116. {
  117. ThrowIfDisposed();
  118. xfeatures2d_StarDetector_setLineThresholdBinarized_10(nativeObj, _lineThresholdBinarized);
  119. }
  120. //
  121. // C++: int cv::xfeatures2d::StarDetector::getLineThresholdBinarized()
  122. //
  123. public int getLineThresholdBinarized()
  124. {
  125. ThrowIfDisposed();
  126. return xfeatures2d_StarDetector_getLineThresholdBinarized_10(nativeObj);
  127. }
  128. //
  129. // C++: void cv::xfeatures2d::StarDetector::setSuppressNonmaxSize(int _suppressNonmaxSize)
  130. //
  131. public void setSuppressNonmaxSize(int _suppressNonmaxSize)
  132. {
  133. ThrowIfDisposed();
  134. xfeatures2d_StarDetector_setSuppressNonmaxSize_10(nativeObj, _suppressNonmaxSize);
  135. }
  136. //
  137. // C++: int cv::xfeatures2d::StarDetector::getSuppressNonmaxSize()
  138. //
  139. public int getSuppressNonmaxSize()
  140. {
  141. ThrowIfDisposed();
  142. return xfeatures2d_StarDetector_getSuppressNonmaxSize_10(nativeObj);
  143. }
  144. //
  145. // C++: String cv::xfeatures2d::StarDetector::getDefaultName()
  146. //
  147. public override string getDefaultName()
  148. {
  149. ThrowIfDisposed();
  150. string retVal = Marshal.PtrToStringAnsi(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_StarDetector_getDefaultName_10(nativeObj)));
  151. return retVal;
  152. }
  153. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  154. const string LIBNAME = "__Internal";
  155. #else
  156. const string LIBNAME = "opencvforunity";
  157. #endif
  158. // C++: static Ptr_StarDetector cv::xfeatures2d::StarDetector::create(int maxSize = 45, int responseThreshold = 30, int lineThresholdProjected = 10, int lineThresholdBinarized = 8, int suppressNonmaxSize = 5)
  159. [DllImport(LIBNAME)]
  160. private static extern IntPtr xfeatures2d_StarDetector_create_10(int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized, int suppressNonmaxSize);
  161. [DllImport(LIBNAME)]
  162. private static extern IntPtr xfeatures2d_StarDetector_create_11(int maxSize, int responseThreshold, int lineThresholdProjected, int lineThresholdBinarized);
  163. [DllImport(LIBNAME)]
  164. private static extern IntPtr xfeatures2d_StarDetector_create_12(int maxSize, int responseThreshold, int lineThresholdProjected);
  165. [DllImport(LIBNAME)]
  166. private static extern IntPtr xfeatures2d_StarDetector_create_13(int maxSize, int responseThreshold);
  167. [DllImport(LIBNAME)]
  168. private static extern IntPtr xfeatures2d_StarDetector_create_14(int maxSize);
  169. [DllImport(LIBNAME)]
  170. private static extern IntPtr xfeatures2d_StarDetector_create_15();
  171. // C++: void cv::xfeatures2d::StarDetector::setMaxSize(int _maxSize)
  172. [DllImport(LIBNAME)]
  173. private static extern void xfeatures2d_StarDetector_setMaxSize_10(IntPtr nativeObj, int _maxSize);
  174. // C++: int cv::xfeatures2d::StarDetector::getMaxSize()
  175. [DllImport(LIBNAME)]
  176. private static extern int xfeatures2d_StarDetector_getMaxSize_10(IntPtr nativeObj);
  177. // C++: void cv::xfeatures2d::StarDetector::setResponseThreshold(int _responseThreshold)
  178. [DllImport(LIBNAME)]
  179. private static extern void xfeatures2d_StarDetector_setResponseThreshold_10(IntPtr nativeObj, int _responseThreshold);
  180. // C++: int cv::xfeatures2d::StarDetector::getResponseThreshold()
  181. [DllImport(LIBNAME)]
  182. private static extern int xfeatures2d_StarDetector_getResponseThreshold_10(IntPtr nativeObj);
  183. // C++: void cv::xfeatures2d::StarDetector::setLineThresholdProjected(int _lineThresholdProjected)
  184. [DllImport(LIBNAME)]
  185. private static extern void xfeatures2d_StarDetector_setLineThresholdProjected_10(IntPtr nativeObj, int _lineThresholdProjected);
  186. // C++: int cv::xfeatures2d::StarDetector::getLineThresholdProjected()
  187. [DllImport(LIBNAME)]
  188. private static extern int xfeatures2d_StarDetector_getLineThresholdProjected_10(IntPtr nativeObj);
  189. // C++: void cv::xfeatures2d::StarDetector::setLineThresholdBinarized(int _lineThresholdBinarized)
  190. [DllImport(LIBNAME)]
  191. private static extern void xfeatures2d_StarDetector_setLineThresholdBinarized_10(IntPtr nativeObj, int _lineThresholdBinarized);
  192. // C++: int cv::xfeatures2d::StarDetector::getLineThresholdBinarized()
  193. [DllImport(LIBNAME)]
  194. private static extern int xfeatures2d_StarDetector_getLineThresholdBinarized_10(IntPtr nativeObj);
  195. // C++: void cv::xfeatures2d::StarDetector::setSuppressNonmaxSize(int _suppressNonmaxSize)
  196. [DllImport(LIBNAME)]
  197. private static extern void xfeatures2d_StarDetector_setSuppressNonmaxSize_10(IntPtr nativeObj, int _suppressNonmaxSize);
  198. // C++: int cv::xfeatures2d::StarDetector::getSuppressNonmaxSize()
  199. [DllImport(LIBNAME)]
  200. private static extern int xfeatures2d_StarDetector_getSuppressNonmaxSize_10(IntPtr nativeObj);
  201. // C++: String cv::xfeatures2d::StarDetector::getDefaultName()
  202. [DllImport(LIBNAME)]
  203. private static extern IntPtr xfeatures2d_StarDetector_getDefaultName_10(IntPtr nativeObj);
  204. // native support for java finalize()
  205. [DllImport(LIBNAME)]
  206. private static extern void xfeatures2d_StarDetector_delete(IntPtr nativeObj);
  207. }
  208. }