VGG.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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. // C++: class VGG
  10. //javadoc: VGG
  11. public class VGG : Feature2D {
  12. protected override void Dispose(bool disposing) {
  13. #if (UNITY_ANDROID && !UNITY_EDITOR)
  14. try {
  15. if (disposing) {
  16. }
  17. if (IsEnabledDispose) {
  18. if (nativeObj != IntPtr.Zero)
  19. xfeatures2d_VGG_delete(nativeObj);
  20. nativeObj = IntPtr.Zero;
  21. }
  22. } finally {
  23. base.Dispose(disposing);
  24. }
  25. #else
  26. return;
  27. #endif
  28. }
  29. protected internal VGG(IntPtr addr) : base(addr) { }
  30. // internal usage only
  31. public static new VGG __fromPtr__(IntPtr addr) { return new VGG(addr); }
  32. //
  33. // C++: static Ptr_VGG cv::xfeatures2d::VGG::create(int desc = VGG::VGG_120, float isigma = 1.4f, bool img_normalize = true, bool use_scale_orientation = true, float scale_factor = 6.25f, bool dsc_normalize = false)
  34. //
  35. //javadoc: VGG::create(desc, isigma, img_normalize, use_scale_orientation, scale_factor, dsc_normalize)
  36. public static VGG create(int desc, float isigma, bool img_normalize, bool use_scale_orientation, float scale_factor, bool dsc_normalize) {
  37. #if (UNITY_ANDROID && !UNITY_EDITOR)
  38. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_10(desc, isigma, img_normalize, use_scale_orientation, scale_factor, dsc_normalize));
  39. return retVal;
  40. #else
  41. return null;
  42. #endif
  43. }
  44. //javadoc: VGG::create(desc, isigma, img_normalize, use_scale_orientation, scale_factor)
  45. public static VGG create(int desc, float isigma, bool img_normalize, bool use_scale_orientation, float scale_factor) {
  46. #if (UNITY_ANDROID && !UNITY_EDITOR)
  47. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_11(desc, isigma, img_normalize, use_scale_orientation, scale_factor));
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //javadoc: VGG::create(desc, isigma, img_normalize, use_scale_orientation)
  54. public static VGG create(int desc, float isigma, bool img_normalize, bool use_scale_orientation) {
  55. #if (UNITY_ANDROID && !UNITY_EDITOR)
  56. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_12(desc, isigma, img_normalize, use_scale_orientation));
  57. return retVal;
  58. #else
  59. return null;
  60. #endif
  61. }
  62. //javadoc: VGG::create(desc, isigma, img_normalize)
  63. public static VGG create(int desc, float isigma, bool img_normalize) {
  64. #if (UNITY_ANDROID && !UNITY_EDITOR)
  65. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_13(desc, isigma, img_normalize));
  66. return retVal;
  67. #else
  68. return null;
  69. #endif
  70. }
  71. //javadoc: VGG::create(desc, isigma)
  72. public static VGG create(int desc, float isigma) {
  73. #if (UNITY_ANDROID && !UNITY_EDITOR)
  74. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_14(desc, isigma));
  75. return retVal;
  76. #else
  77. return null;
  78. #endif
  79. }
  80. //javadoc: VGG::create(desc)
  81. public static VGG create(int desc) {
  82. #if (UNITY_ANDROID && !UNITY_EDITOR)
  83. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_15(desc));
  84. return retVal;
  85. #else
  86. return null;
  87. #endif
  88. }
  89. //javadoc: VGG::create()
  90. public static VGG create() {
  91. #if (UNITY_ANDROID && !UNITY_EDITOR)
  92. VGG retVal = VGG.__fromPtr__(xfeatures2d_VGG_create_16());
  93. return retVal;
  94. #else
  95. return null;
  96. #endif
  97. }
  98. //
  99. // C++: bool cv::xfeatures2d::VGG::getUseNormalizeDescriptor()
  100. //
  101. //javadoc: VGG::getUseNormalizeDescriptor()
  102. public bool getUseNormalizeDescriptor() {
  103. ThrowIfDisposed();
  104. #if (UNITY_ANDROID && !UNITY_EDITOR)
  105. bool retVal = xfeatures2d_VGG_getUseNormalizeDescriptor_10(nativeObj);
  106. return retVal;
  107. #else
  108. return false;
  109. #endif
  110. }
  111. //
  112. // C++: bool cv::xfeatures2d::VGG::getUseNormalizeImage()
  113. //
  114. //javadoc: VGG::getUseNormalizeImage()
  115. public bool getUseNormalizeImage() {
  116. ThrowIfDisposed();
  117. #if (UNITY_ANDROID && !UNITY_EDITOR)
  118. bool retVal = xfeatures2d_VGG_getUseNormalizeImage_10(nativeObj);
  119. return retVal;
  120. #else
  121. return false;
  122. #endif
  123. }
  124. //
  125. // C++: bool cv::xfeatures2d::VGG::getUseScaleOrientation()
  126. //
  127. //javadoc: VGG::getUseScaleOrientation()
  128. public bool getUseScaleOrientation() {
  129. ThrowIfDisposed();
  130. #if (UNITY_ANDROID && !UNITY_EDITOR)
  131. bool retVal = xfeatures2d_VGG_getUseScaleOrientation_10(nativeObj);
  132. return retVal;
  133. #else
  134. return false;
  135. #endif
  136. }
  137. //
  138. // C++: float cv::xfeatures2d::VGG::getScaleFactor()
  139. //
  140. //javadoc: VGG::getScaleFactor()
  141. public float getScaleFactor() {
  142. ThrowIfDisposed();
  143. #if (UNITY_ANDROID && !UNITY_EDITOR)
  144. float retVal = xfeatures2d_VGG_getScaleFactor_10(nativeObj);
  145. return retVal;
  146. #else
  147. return -1;
  148. #endif
  149. }
  150. //
  151. // C++: float cv::xfeatures2d::VGG::getSigma()
  152. //
  153. //javadoc: VGG::getSigma()
  154. public float getSigma() {
  155. ThrowIfDisposed();
  156. #if (UNITY_ANDROID && !UNITY_EDITOR)
  157. float retVal = xfeatures2d_VGG_getSigma_10(nativeObj);
  158. return retVal;
  159. #else
  160. return -1;
  161. #endif
  162. }
  163. //
  164. // C++: void cv::xfeatures2d::VGG::setScaleFactor(float scale_factor)
  165. //
  166. //javadoc: VGG::setScaleFactor(scale_factor)
  167. public void setScaleFactor(float scale_factor) {
  168. ThrowIfDisposed();
  169. #if (UNITY_ANDROID && !UNITY_EDITOR)
  170. xfeatures2d_VGG_setScaleFactor_10(nativeObj, scale_factor);
  171. return;
  172. #else
  173. return;
  174. #endif
  175. }
  176. //
  177. // C++: void cv::xfeatures2d::VGG::setSigma(float isigma)
  178. //
  179. //javadoc: VGG::setSigma(isigma)
  180. public void setSigma(float isigma) {
  181. ThrowIfDisposed();
  182. #if (UNITY_ANDROID && !UNITY_EDITOR)
  183. xfeatures2d_VGG_setSigma_10(nativeObj, isigma);
  184. return;
  185. #else
  186. return;
  187. #endif
  188. }
  189. //
  190. // C++: void cv::xfeatures2d::VGG::setUseNormalizeDescriptor(bool dsc_normalize)
  191. //
  192. //javadoc: VGG::setUseNormalizeDescriptor(dsc_normalize)
  193. public void setUseNormalizeDescriptor(bool dsc_normalize) {
  194. ThrowIfDisposed();
  195. #if (UNITY_ANDROID && !UNITY_EDITOR)
  196. xfeatures2d_VGG_setUseNormalizeDescriptor_10(nativeObj, dsc_normalize);
  197. return;
  198. #else
  199. return;
  200. #endif
  201. }
  202. //
  203. // C++: void cv::xfeatures2d::VGG::setUseNormalizeImage(bool img_normalize)
  204. //
  205. //javadoc: VGG::setUseNormalizeImage(img_normalize)
  206. public void setUseNormalizeImage(bool img_normalize) {
  207. ThrowIfDisposed();
  208. #if (UNITY_ANDROID && !UNITY_EDITOR)
  209. xfeatures2d_VGG_setUseNormalizeImage_10(nativeObj, img_normalize);
  210. return;
  211. #else
  212. return;
  213. #endif
  214. }
  215. //
  216. // C++: void cv::xfeatures2d::VGG::setUseScaleOrientation(bool use_scale_orientation)
  217. //
  218. //javadoc: VGG::setUseScaleOrientation(use_scale_orientation)
  219. public void setUseScaleOrientation(bool use_scale_orientation) {
  220. ThrowIfDisposed();
  221. #if (UNITY_ANDROID && !UNITY_EDITOR)
  222. xfeatures2d_VGG_setUseScaleOrientation_10(nativeObj, use_scale_orientation);
  223. return;
  224. #else
  225. return;
  226. #endif
  227. }
  228. #if (UNITY_ANDROID && !UNITY_EDITOR)
  229. const string LIBNAME = "opencvforunity";
  230. // C++: static Ptr_VGG cv::xfeatures2d::VGG::create(int desc = VGG::VGG_120, float isigma = 1.4f, bool img_normalize = true, bool use_scale_orientation = true, float scale_factor = 6.25f, bool dsc_normalize = false)
  231. [DllImport(LIBNAME)]
  232. private static extern IntPtr xfeatures2d_VGG_create_10(int desc, float isigma, bool img_normalize, bool use_scale_orientation, float scale_factor, bool dsc_normalize);
  233. [DllImport(LIBNAME)]
  234. private static extern IntPtr xfeatures2d_VGG_create_11(int desc, float isigma, bool img_normalize, bool use_scale_orientation, float scale_factor);
  235. [DllImport(LIBNAME)]
  236. private static extern IntPtr xfeatures2d_VGG_create_12(int desc, float isigma, bool img_normalize, bool use_scale_orientation);
  237. [DllImport(LIBNAME)]
  238. private static extern IntPtr xfeatures2d_VGG_create_13(int desc, float isigma, bool img_normalize);
  239. [DllImport(LIBNAME)]
  240. private static extern IntPtr xfeatures2d_VGG_create_14(int desc, float isigma);
  241. [DllImport(LIBNAME)]
  242. private static extern IntPtr xfeatures2d_VGG_create_15(int desc);
  243. [DllImport(LIBNAME)]
  244. private static extern IntPtr xfeatures2d_VGG_create_16();
  245. // C++: bool cv::xfeatures2d::VGG::getUseNormalizeDescriptor()
  246. [DllImport(LIBNAME)]
  247. private static extern bool xfeatures2d_VGG_getUseNormalizeDescriptor_10(IntPtr nativeObj);
  248. // C++: bool cv::xfeatures2d::VGG::getUseNormalizeImage()
  249. [DllImport(LIBNAME)]
  250. private static extern bool xfeatures2d_VGG_getUseNormalizeImage_10(IntPtr nativeObj);
  251. // C++: bool cv::xfeatures2d::VGG::getUseScaleOrientation()
  252. [DllImport(LIBNAME)]
  253. private static extern bool xfeatures2d_VGG_getUseScaleOrientation_10(IntPtr nativeObj);
  254. // C++: float cv::xfeatures2d::VGG::getScaleFactor()
  255. [DllImport(LIBNAME)]
  256. private static extern float xfeatures2d_VGG_getScaleFactor_10(IntPtr nativeObj);
  257. // C++: float cv::xfeatures2d::VGG::getSigma()
  258. [DllImport(LIBNAME)]
  259. private static extern float xfeatures2d_VGG_getSigma_10(IntPtr nativeObj);
  260. // C++: void cv::xfeatures2d::VGG::setScaleFactor(float scale_factor)
  261. [DllImport(LIBNAME)]
  262. private static extern void xfeatures2d_VGG_setScaleFactor_10(IntPtr nativeObj, float scale_factor);
  263. // C++: void cv::xfeatures2d::VGG::setSigma(float isigma)
  264. [DllImport(LIBNAME)]
  265. private static extern void xfeatures2d_VGG_setSigma_10(IntPtr nativeObj, float isigma);
  266. // C++: void cv::xfeatures2d::VGG::setUseNormalizeDescriptor(bool dsc_normalize)
  267. [DllImport(LIBNAME)]
  268. private static extern void xfeatures2d_VGG_setUseNormalizeDescriptor_10(IntPtr nativeObj, bool dsc_normalize);
  269. // C++: void cv::xfeatures2d::VGG::setUseNormalizeImage(bool img_normalize)
  270. [DllImport(LIBNAME)]
  271. private static extern void xfeatures2d_VGG_setUseNormalizeImage_10(IntPtr nativeObj, bool img_normalize);
  272. // C++: void cv::xfeatures2d::VGG::setUseScaleOrientation(bool use_scale_orientation)
  273. [DllImport(LIBNAME)]
  274. private static extern void xfeatures2d_VGG_setUseScaleOrientation_10(IntPtr nativeObj, bool use_scale_orientation);
  275. // native support for java finalize()
  276. [DllImport(LIBNAME)]
  277. private static extern void xfeatures2d_VGG_delete(IntPtr nativeObj);
  278. #endif
  279. }
  280. }