VGG.cs 13 KB

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