HarrisLaplaceFeatureDetector.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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 HarrisLaplaceFeatureDetector
  10. /**
  11. * Class implementing the Harris-Laplace feature detector as described in CITE: Mikolajczyk2004.
  12. */
  13. public class HarrisLaplaceFeatureDetector : 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_HarrisLaplaceFeatureDetector_delete(nativeObj);
  26. nativeObj = IntPtr.Zero;
  27. }
  28. }
  29. finally
  30. {
  31. base.Dispose(disposing);
  32. }
  33. }
  34. protected internal HarrisLaplaceFeatureDetector(IntPtr addr) : base(addr) { }
  35. // internal usage only
  36. public static new HarrisLaplaceFeatureDetector __fromPtr__(IntPtr addr) { return new HarrisLaplaceFeatureDetector(addr); }
  37. //
  38. // C++: static Ptr_HarrisLaplaceFeatureDetector cv::xfeatures2d::HarrisLaplaceFeatureDetector::create(int numOctaves = 6, float corn_thresh = 0.01f, float DOG_thresh = 0.01f, int maxCorners = 5000, int num_layers = 4)
  39. //
  40. /**
  41. * Creates a new implementation instance.
  42. *
  43. * param numOctaves the number of octaves in the scale-space pyramid
  44. * param corn_thresh the threshold for the Harris cornerness measure
  45. * param DOG_thresh the threshold for the Difference-of-Gaussians scale selection
  46. * param maxCorners the maximum number of corners to consider
  47. * param num_layers the number of intermediate scales per octave
  48. * return automatically generated
  49. */
  50. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners, int num_layers)
  51. {
  52. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_10(numOctaves, corn_thresh, DOG_thresh, maxCorners, num_layers)));
  53. }
  54. /**
  55. * Creates a new implementation instance.
  56. *
  57. * param numOctaves the number of octaves in the scale-space pyramid
  58. * param corn_thresh the threshold for the Harris cornerness measure
  59. * param DOG_thresh the threshold for the Difference-of-Gaussians scale selection
  60. * param maxCorners the maximum number of corners to consider
  61. * return automatically generated
  62. */
  63. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners)
  64. {
  65. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_11(numOctaves, corn_thresh, DOG_thresh, maxCorners)));
  66. }
  67. /**
  68. * Creates a new implementation instance.
  69. *
  70. * param numOctaves the number of octaves in the scale-space pyramid
  71. * param corn_thresh the threshold for the Harris cornerness measure
  72. * param DOG_thresh the threshold for the Difference-of-Gaussians scale selection
  73. * return automatically generated
  74. */
  75. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh, float DOG_thresh)
  76. {
  77. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_12(numOctaves, corn_thresh, DOG_thresh)));
  78. }
  79. /**
  80. * Creates a new implementation instance.
  81. *
  82. * param numOctaves the number of octaves in the scale-space pyramid
  83. * param corn_thresh the threshold for the Harris cornerness measure
  84. * return automatically generated
  85. */
  86. public static HarrisLaplaceFeatureDetector create(int numOctaves, float corn_thresh)
  87. {
  88. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_13(numOctaves, corn_thresh)));
  89. }
  90. /**
  91. * Creates a new implementation instance.
  92. *
  93. * param numOctaves the number of octaves in the scale-space pyramid
  94. * return automatically generated
  95. */
  96. public static HarrisLaplaceFeatureDetector create(int numOctaves)
  97. {
  98. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_14(numOctaves)));
  99. }
  100. /**
  101. * Creates a new implementation instance.
  102. *
  103. * return automatically generated
  104. */
  105. public static HarrisLaplaceFeatureDetector create()
  106. {
  107. return HarrisLaplaceFeatureDetector.__fromPtr__(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_create_15()));
  108. }
  109. //
  110. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setNumOctaves(int numOctaves_)
  111. //
  112. public void setNumOctaves(int numOctaves_)
  113. {
  114. ThrowIfDisposed();
  115. xfeatures2d_HarrisLaplaceFeatureDetector_setNumOctaves_10(nativeObj, numOctaves_);
  116. }
  117. //
  118. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getNumOctaves()
  119. //
  120. public int getNumOctaves()
  121. {
  122. ThrowIfDisposed();
  123. return xfeatures2d_HarrisLaplaceFeatureDetector_getNumOctaves_10(nativeObj);
  124. }
  125. //
  126. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setCornThresh(float corn_thresh_)
  127. //
  128. public void setCornThresh(float corn_thresh_)
  129. {
  130. ThrowIfDisposed();
  131. xfeatures2d_HarrisLaplaceFeatureDetector_setCornThresh_10(nativeObj, corn_thresh_);
  132. }
  133. //
  134. // C++: float cv::xfeatures2d::HarrisLaplaceFeatureDetector::getCornThresh()
  135. //
  136. public float getCornThresh()
  137. {
  138. ThrowIfDisposed();
  139. return xfeatures2d_HarrisLaplaceFeatureDetector_getCornThresh_10(nativeObj);
  140. }
  141. //
  142. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setDOGThresh(float DOG_thresh_)
  143. //
  144. public void setDOGThresh(float DOG_thresh_)
  145. {
  146. ThrowIfDisposed();
  147. xfeatures2d_HarrisLaplaceFeatureDetector_setDOGThresh_10(nativeObj, DOG_thresh_);
  148. }
  149. //
  150. // C++: float cv::xfeatures2d::HarrisLaplaceFeatureDetector::getDOGThresh()
  151. //
  152. public float getDOGThresh()
  153. {
  154. ThrowIfDisposed();
  155. return xfeatures2d_HarrisLaplaceFeatureDetector_getDOGThresh_10(nativeObj);
  156. }
  157. //
  158. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setMaxCorners(int maxCorners_)
  159. //
  160. public void setMaxCorners(int maxCorners_)
  161. {
  162. ThrowIfDisposed();
  163. xfeatures2d_HarrisLaplaceFeatureDetector_setMaxCorners_10(nativeObj, maxCorners_);
  164. }
  165. //
  166. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getMaxCorners()
  167. //
  168. public int getMaxCorners()
  169. {
  170. ThrowIfDisposed();
  171. return xfeatures2d_HarrisLaplaceFeatureDetector_getMaxCorners_10(nativeObj);
  172. }
  173. //
  174. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setNumLayers(int num_layers_)
  175. //
  176. public void setNumLayers(int num_layers_)
  177. {
  178. ThrowIfDisposed();
  179. xfeatures2d_HarrisLaplaceFeatureDetector_setNumLayers_10(nativeObj, num_layers_);
  180. }
  181. //
  182. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getNumLayers()
  183. //
  184. public int getNumLayers()
  185. {
  186. ThrowIfDisposed();
  187. return xfeatures2d_HarrisLaplaceFeatureDetector_getNumLayers_10(nativeObj);
  188. }
  189. //
  190. // C++: String cv::xfeatures2d::HarrisLaplaceFeatureDetector::getDefaultName()
  191. //
  192. public override string getDefaultName()
  193. {
  194. ThrowIfDisposed();
  195. string retVal = Marshal.PtrToStringAnsi(DisposableObject.ThrowIfNullIntPtr(xfeatures2d_HarrisLaplaceFeatureDetector_getDefaultName_10(nativeObj)));
  196. return retVal;
  197. }
  198. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  199. const string LIBNAME = "__Internal";
  200. #else
  201. const string LIBNAME = "opencvforunity";
  202. #endif
  203. // C++: static Ptr_HarrisLaplaceFeatureDetector cv::xfeatures2d::HarrisLaplaceFeatureDetector::create(int numOctaves = 6, float corn_thresh = 0.01f, float DOG_thresh = 0.01f, int maxCorners = 5000, int num_layers = 4)
  204. [DllImport(LIBNAME)]
  205. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_10(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners, int num_layers);
  206. [DllImport(LIBNAME)]
  207. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_11(int numOctaves, float corn_thresh, float DOG_thresh, int maxCorners);
  208. [DllImport(LIBNAME)]
  209. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_12(int numOctaves, float corn_thresh, float DOG_thresh);
  210. [DllImport(LIBNAME)]
  211. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_13(int numOctaves, float corn_thresh);
  212. [DllImport(LIBNAME)]
  213. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_14(int numOctaves);
  214. [DllImport(LIBNAME)]
  215. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_create_15();
  216. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setNumOctaves(int numOctaves_)
  217. [DllImport(LIBNAME)]
  218. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_setNumOctaves_10(IntPtr nativeObj, int numOctaves_);
  219. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getNumOctaves()
  220. [DllImport(LIBNAME)]
  221. private static extern int xfeatures2d_HarrisLaplaceFeatureDetector_getNumOctaves_10(IntPtr nativeObj);
  222. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setCornThresh(float corn_thresh_)
  223. [DllImport(LIBNAME)]
  224. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_setCornThresh_10(IntPtr nativeObj, float corn_thresh_);
  225. // C++: float cv::xfeatures2d::HarrisLaplaceFeatureDetector::getCornThresh()
  226. [DllImport(LIBNAME)]
  227. private static extern float xfeatures2d_HarrisLaplaceFeatureDetector_getCornThresh_10(IntPtr nativeObj);
  228. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setDOGThresh(float DOG_thresh_)
  229. [DllImport(LIBNAME)]
  230. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_setDOGThresh_10(IntPtr nativeObj, float DOG_thresh_);
  231. // C++: float cv::xfeatures2d::HarrisLaplaceFeatureDetector::getDOGThresh()
  232. [DllImport(LIBNAME)]
  233. private static extern float xfeatures2d_HarrisLaplaceFeatureDetector_getDOGThresh_10(IntPtr nativeObj);
  234. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setMaxCorners(int maxCorners_)
  235. [DllImport(LIBNAME)]
  236. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_setMaxCorners_10(IntPtr nativeObj, int maxCorners_);
  237. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getMaxCorners()
  238. [DllImport(LIBNAME)]
  239. private static extern int xfeatures2d_HarrisLaplaceFeatureDetector_getMaxCorners_10(IntPtr nativeObj);
  240. // C++: void cv::xfeatures2d::HarrisLaplaceFeatureDetector::setNumLayers(int num_layers_)
  241. [DllImport(LIBNAME)]
  242. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_setNumLayers_10(IntPtr nativeObj, int num_layers_);
  243. // C++: int cv::xfeatures2d::HarrisLaplaceFeatureDetector::getNumLayers()
  244. [DllImport(LIBNAME)]
  245. private static extern int xfeatures2d_HarrisLaplaceFeatureDetector_getNumLayers_10(IntPtr nativeObj);
  246. // C++: String cv::xfeatures2d::HarrisLaplaceFeatureDetector::getDefaultName()
  247. [DllImport(LIBNAME)]
  248. private static extern IntPtr xfeatures2d_HarrisLaplaceFeatureDetector_getDefaultName_10(IntPtr nativeObj);
  249. // native support for java finalize()
  250. [DllImport(LIBNAME)]
  251. private static extern void xfeatures2d_HarrisLaplaceFeatureDetector_delete(IntPtr nativeObj);
  252. }
  253. }