AKAZE.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. 
  2. using OpenCVForUnity.CoreModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.Features2dModule
  8. {
  9. // C++: class AKAZE
  10. //javadoc: AKAZE
  11. public class AKAZE : Feature2D
  12. {
  13. protected override void Dispose (bool disposing)
  14. {
  15. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  16. try {
  17. if (disposing) {
  18. }
  19. if (IsEnabledDispose) {
  20. if (nativeObj != IntPtr.Zero)
  21. features2d_AKAZE_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal AKAZE (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new AKAZE __fromPtr__ (IntPtr addr)
  37. {
  38. return new AKAZE (addr);
  39. }
  40. // C++: enum DescriptorType
  41. public const int DESCRIPTOR_KAZE_UPRIGHT = 2;
  42. public const int DESCRIPTOR_KAZE = 3;
  43. public const int DESCRIPTOR_MLDB_UPRIGHT = 4;
  44. public const int DESCRIPTOR_MLDB = 5;
  45. //
  46. // C++: AKAZE_DescriptorType cv::AKAZE::getDescriptorType()
  47. //
  48. //javadoc: AKAZE::getDescriptorType()
  49. public int getDescriptorType ()
  50. {
  51. ThrowIfDisposed ();
  52. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  53. int retVal = features2d_AKAZE_getDescriptorType_10 (nativeObj);
  54. return retVal;
  55. #else
  56. return -1;
  57. #endif
  58. }
  59. //
  60. // C++: KAZE_DiffusivityType cv::AKAZE::getDiffusivity()
  61. //
  62. //javadoc: AKAZE::getDiffusivity()
  63. public int getDiffusivity ()
  64. {
  65. ThrowIfDisposed ();
  66. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  67. int retVal = features2d_AKAZE_getDiffusivity_10 (nativeObj);
  68. return retVal;
  69. #else
  70. return -1;
  71. #endif
  72. }
  73. //
  74. // C++: static Ptr_AKAZE cv::AKAZE::create(AKAZE_DescriptorType descriptor_type = AKAZE::DESCRIPTOR_MLDB, int descriptor_size = 0, int descriptor_channels = 3, float threshold = 0.001f, int nOctaves = 4, int nOctaveLayers = 4, KAZE_DiffusivityType diffusivity = KAZE::DIFF_PM_G2)
  75. //
  76. //javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers, diffusivity)
  77. public static AKAZE create (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers, int diffusivity)
  78. {
  79. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  80. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_10 (descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers, diffusivity));
  81. return retVal;
  82. #else
  83. return null;
  84. #endif
  85. }
  86. //javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers)
  87. public static AKAZE create (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers)
  88. {
  89. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  90. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_11 (descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves, nOctaveLayers));
  91. return retVal;
  92. #else
  93. return null;
  94. #endif
  95. }
  96. //javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves)
  97. public static AKAZE create (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves)
  98. {
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_12 (descriptor_type, descriptor_size, descriptor_channels, threshold, nOctaves));
  101. return retVal;
  102. #else
  103. return null;
  104. #endif
  105. }
  106. //javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels, threshold)
  107. public static AKAZE create (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold)
  108. {
  109. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  110. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_13 (descriptor_type, descriptor_size, descriptor_channels, threshold));
  111. return retVal;
  112. #else
  113. return null;
  114. #endif
  115. }
  116. //javadoc: AKAZE::create(descriptor_type, descriptor_size, descriptor_channels)
  117. public static AKAZE create (int descriptor_type, int descriptor_size, int descriptor_channels)
  118. {
  119. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  120. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_14 (descriptor_type, descriptor_size, descriptor_channels));
  121. return retVal;
  122. #else
  123. return null;
  124. #endif
  125. }
  126. //javadoc: AKAZE::create(descriptor_type, descriptor_size)
  127. public static AKAZE create (int descriptor_type, int descriptor_size)
  128. {
  129. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  130. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_15 (descriptor_type, descriptor_size));
  131. return retVal;
  132. #else
  133. return null;
  134. #endif
  135. }
  136. //javadoc: AKAZE::create(descriptor_type)
  137. public static AKAZE create (int descriptor_type)
  138. {
  139. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  140. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_16 (descriptor_type));
  141. return retVal;
  142. #else
  143. return null;
  144. #endif
  145. }
  146. //javadoc: AKAZE::create()
  147. public static AKAZE create ()
  148. {
  149. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  150. AKAZE retVal = AKAZE.__fromPtr__ (features2d_AKAZE_create_17 ());
  151. return retVal;
  152. #else
  153. return null;
  154. #endif
  155. }
  156. //
  157. // C++: String cv::AKAZE::getDefaultName()
  158. //
  159. //javadoc: AKAZE::getDefaultName()
  160. public override string getDefaultName ()
  161. {
  162. ThrowIfDisposed ();
  163. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  164. string retVal = Marshal.PtrToStringAnsi (features2d_AKAZE_getDefaultName_10 (nativeObj));
  165. return retVal;
  166. #else
  167. return null;
  168. #endif
  169. }
  170. //
  171. // C++: double cv::AKAZE::getThreshold()
  172. //
  173. //javadoc: AKAZE::getThreshold()
  174. public double getThreshold ()
  175. {
  176. ThrowIfDisposed ();
  177. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  178. double retVal = features2d_AKAZE_getThreshold_10 (nativeObj);
  179. return retVal;
  180. #else
  181. return -1;
  182. #endif
  183. }
  184. //
  185. // C++: int cv::AKAZE::getDescriptorChannels()
  186. //
  187. //javadoc: AKAZE::getDescriptorChannels()
  188. public int getDescriptorChannels ()
  189. {
  190. ThrowIfDisposed ();
  191. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  192. int retVal = features2d_AKAZE_getDescriptorChannels_10 (nativeObj);
  193. return retVal;
  194. #else
  195. return -1;
  196. #endif
  197. }
  198. //
  199. // C++: int cv::AKAZE::getDescriptorSize()
  200. //
  201. //javadoc: AKAZE::getDescriptorSize()
  202. public int getDescriptorSize ()
  203. {
  204. ThrowIfDisposed ();
  205. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  206. int retVal = features2d_AKAZE_getDescriptorSize_10 (nativeObj);
  207. return retVal;
  208. #else
  209. return -1;
  210. #endif
  211. }
  212. //
  213. // C++: int cv::AKAZE::getNOctaveLayers()
  214. //
  215. //javadoc: AKAZE::getNOctaveLayers()
  216. public int getNOctaveLayers ()
  217. {
  218. ThrowIfDisposed ();
  219. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  220. int retVal = features2d_AKAZE_getNOctaveLayers_10 (nativeObj);
  221. return retVal;
  222. #else
  223. return -1;
  224. #endif
  225. }
  226. //
  227. // C++: int cv::AKAZE::getNOctaves()
  228. //
  229. //javadoc: AKAZE::getNOctaves()
  230. public int getNOctaves ()
  231. {
  232. ThrowIfDisposed ();
  233. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  234. int retVal = features2d_AKAZE_getNOctaves_10 (nativeObj);
  235. return retVal;
  236. #else
  237. return -1;
  238. #endif
  239. }
  240. //
  241. // C++: void cv::AKAZE::setDescriptorChannels(int dch)
  242. //
  243. //javadoc: AKAZE::setDescriptorChannels(dch)
  244. public void setDescriptorChannels (int dch)
  245. {
  246. ThrowIfDisposed ();
  247. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  248. features2d_AKAZE_setDescriptorChannels_10 (nativeObj, dch);
  249. return;
  250. #else
  251. return;
  252. #endif
  253. }
  254. //
  255. // C++: void cv::AKAZE::setDescriptorSize(int dsize)
  256. //
  257. //javadoc: AKAZE::setDescriptorSize(dsize)
  258. public void setDescriptorSize (int dsize)
  259. {
  260. ThrowIfDisposed ();
  261. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  262. features2d_AKAZE_setDescriptorSize_10 (nativeObj, dsize);
  263. return;
  264. #else
  265. return;
  266. #endif
  267. }
  268. //
  269. // C++: void cv::AKAZE::setDescriptorType(AKAZE_DescriptorType dtype)
  270. //
  271. //javadoc: AKAZE::setDescriptorType(dtype)
  272. public void setDescriptorType (int dtype)
  273. {
  274. ThrowIfDisposed ();
  275. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  276. features2d_AKAZE_setDescriptorType_10 (nativeObj, dtype);
  277. return;
  278. #else
  279. return;
  280. #endif
  281. }
  282. //
  283. // C++: void cv::AKAZE::setDiffusivity(KAZE_DiffusivityType diff)
  284. //
  285. //javadoc: AKAZE::setDiffusivity(diff)
  286. public void setDiffusivity (int diff)
  287. {
  288. ThrowIfDisposed ();
  289. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  290. features2d_AKAZE_setDiffusivity_10 (nativeObj, diff);
  291. return;
  292. #else
  293. return;
  294. #endif
  295. }
  296. //
  297. // C++: void cv::AKAZE::setNOctaveLayers(int octaveLayers)
  298. //
  299. //javadoc: AKAZE::setNOctaveLayers(octaveLayers)
  300. public void setNOctaveLayers (int octaveLayers)
  301. {
  302. ThrowIfDisposed ();
  303. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  304. features2d_AKAZE_setNOctaveLayers_10 (nativeObj, octaveLayers);
  305. return;
  306. #else
  307. return;
  308. #endif
  309. }
  310. //
  311. // C++: void cv::AKAZE::setNOctaves(int octaves)
  312. //
  313. //javadoc: AKAZE::setNOctaves(octaves)
  314. public void setNOctaves (int octaves)
  315. {
  316. ThrowIfDisposed ();
  317. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  318. features2d_AKAZE_setNOctaves_10 (nativeObj, octaves);
  319. return;
  320. #else
  321. return;
  322. #endif
  323. }
  324. //
  325. // C++: void cv::AKAZE::setThreshold(double threshold)
  326. //
  327. //javadoc: AKAZE::setThreshold(threshold)
  328. public void setThreshold (double threshold)
  329. {
  330. ThrowIfDisposed ();
  331. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  332. features2d_AKAZE_setThreshold_10 (nativeObj, threshold);
  333. return;
  334. #else
  335. return;
  336. #endif
  337. }
  338. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  339. const string LIBNAME = "__Internal";
  340. #else
  341. const string LIBNAME = "opencvforunity";
  342. #endif
  343. // C++: AKAZE_DescriptorType cv::AKAZE::getDescriptorType()
  344. [DllImport (LIBNAME)]
  345. private static extern int features2d_AKAZE_getDescriptorType_10 (IntPtr nativeObj);
  346. // C++: KAZE_DiffusivityType cv::AKAZE::getDiffusivity()
  347. [DllImport (LIBNAME)]
  348. private static extern int features2d_AKAZE_getDiffusivity_10 (IntPtr nativeObj);
  349. // C++: static Ptr_AKAZE cv::AKAZE::create(AKAZE_DescriptorType descriptor_type = AKAZE::DESCRIPTOR_MLDB, int descriptor_size = 0, int descriptor_channels = 3, float threshold = 0.001f, int nOctaves = 4, int nOctaveLayers = 4, KAZE_DiffusivityType diffusivity = KAZE::DIFF_PM_G2)
  350. [DllImport (LIBNAME)]
  351. private static extern IntPtr features2d_AKAZE_create_10 (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers, int diffusivity);
  352. [DllImport (LIBNAME)]
  353. private static extern IntPtr features2d_AKAZE_create_11 (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves, int nOctaveLayers);
  354. [DllImport (LIBNAME)]
  355. private static extern IntPtr features2d_AKAZE_create_12 (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold, int nOctaves);
  356. [DllImport (LIBNAME)]
  357. private static extern IntPtr features2d_AKAZE_create_13 (int descriptor_type, int descriptor_size, int descriptor_channels, float threshold);
  358. [DllImport (LIBNAME)]
  359. private static extern IntPtr features2d_AKAZE_create_14 (int descriptor_type, int descriptor_size, int descriptor_channels);
  360. [DllImport (LIBNAME)]
  361. private static extern IntPtr features2d_AKAZE_create_15 (int descriptor_type, int descriptor_size);
  362. [DllImport (LIBNAME)]
  363. private static extern IntPtr features2d_AKAZE_create_16 (int descriptor_type);
  364. [DllImport (LIBNAME)]
  365. private static extern IntPtr features2d_AKAZE_create_17 ();
  366. // C++: String cv::AKAZE::getDefaultName()
  367. [DllImport (LIBNAME)]
  368. private static extern IntPtr features2d_AKAZE_getDefaultName_10 (IntPtr nativeObj);
  369. // C++: double cv::AKAZE::getThreshold()
  370. [DllImport (LIBNAME)]
  371. private static extern double features2d_AKAZE_getThreshold_10 (IntPtr nativeObj);
  372. // C++: int cv::AKAZE::getDescriptorChannels()
  373. [DllImport (LIBNAME)]
  374. private static extern int features2d_AKAZE_getDescriptorChannels_10 (IntPtr nativeObj);
  375. // C++: int cv::AKAZE::getDescriptorSize()
  376. [DllImport (LIBNAME)]
  377. private static extern int features2d_AKAZE_getDescriptorSize_10 (IntPtr nativeObj);
  378. // C++: int cv::AKAZE::getNOctaveLayers()
  379. [DllImport (LIBNAME)]
  380. private static extern int features2d_AKAZE_getNOctaveLayers_10 (IntPtr nativeObj);
  381. // C++: int cv::AKAZE::getNOctaves()
  382. [DllImport (LIBNAME)]
  383. private static extern int features2d_AKAZE_getNOctaves_10 (IntPtr nativeObj);
  384. // C++: void cv::AKAZE::setDescriptorChannels(int dch)
  385. [DllImport (LIBNAME)]
  386. private static extern void features2d_AKAZE_setDescriptorChannels_10 (IntPtr nativeObj, int dch);
  387. // C++: void cv::AKAZE::setDescriptorSize(int dsize)
  388. [DllImport (LIBNAME)]
  389. private static extern void features2d_AKAZE_setDescriptorSize_10 (IntPtr nativeObj, int dsize);
  390. // C++: void cv::AKAZE::setDescriptorType(AKAZE_DescriptorType dtype)
  391. [DllImport (LIBNAME)]
  392. private static extern void features2d_AKAZE_setDescriptorType_10 (IntPtr nativeObj, int dtype);
  393. // C++: void cv::AKAZE::setDiffusivity(KAZE_DiffusivityType diff)
  394. [DllImport (LIBNAME)]
  395. private static extern void features2d_AKAZE_setDiffusivity_10 (IntPtr nativeObj, int diff);
  396. // C++: void cv::AKAZE::setNOctaveLayers(int octaveLayers)
  397. [DllImport (LIBNAME)]
  398. private static extern void features2d_AKAZE_setNOctaveLayers_10 (IntPtr nativeObj, int octaveLayers);
  399. // C++: void cv::AKAZE::setNOctaves(int octaves)
  400. [DllImport (LIBNAME)]
  401. private static extern void features2d_AKAZE_setNOctaves_10 (IntPtr nativeObj, int octaves);
  402. // C++: void cv::AKAZE::setThreshold(double threshold)
  403. [DllImport (LIBNAME)]
  404. private static extern void features2d_AKAZE_setThreshold_10 (IntPtr nativeObj, double threshold);
  405. // native support for java finalize()
  406. [DllImport (LIBNAME)]
  407. private static extern void features2d_AKAZE_delete (IntPtr nativeObj);
  408. }
  409. }