GFTTDetector.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  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 GFTTDetector
  10. //javadoc: GFTTDetector
  11. public class GFTTDetector : 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_GFTTDetector_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal GFTTDetector (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new GFTTDetector __fromPtr__ (IntPtr addr)
  37. {
  38. return new GFTTDetector (addr);
  39. }
  40. //
  41. // C++: static Ptr_GFTTDetector cv::GFTTDetector::create(int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector = false, double k = 0.04)
  42. //
  43. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, gradiantSize, useHarrisDetector, k)
  44. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector, double k)
  45. {
  46. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  47. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_10 (maxCorners, qualityLevel, minDistance, blockSize, gradiantSize, useHarrisDetector, k));
  48. return retVal;
  49. #else
  50. return null;
  51. #endif
  52. }
  53. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, gradiantSize, useHarrisDetector)
  54. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector)
  55. {
  56. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  57. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_11 (maxCorners, qualityLevel, minDistance, blockSize, gradiantSize, useHarrisDetector));
  58. return retVal;
  59. #else
  60. return null;
  61. #endif
  62. }
  63. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, gradiantSize)
  64. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize)
  65. {
  66. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  67. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_12 (maxCorners, qualityLevel, minDistance, blockSize, gradiantSize));
  68. return retVal;
  69. #else
  70. return null;
  71. #endif
  72. }
  73. //
  74. // C++: static Ptr_GFTTDetector cv::GFTTDetector::create(int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 1, int blockSize = 3, bool useHarrisDetector = false, double k = 0.04)
  75. //
  76. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k)
  77. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize, bool useHarrisDetector, double k)
  78. {
  79. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  80. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_13 (maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector, k));
  81. return retVal;
  82. #else
  83. return null;
  84. #endif
  85. }
  86. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector)
  87. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize, bool useHarrisDetector)
  88. {
  89. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  90. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_14 (maxCorners, qualityLevel, minDistance, blockSize, useHarrisDetector));
  91. return retVal;
  92. #else
  93. return null;
  94. #endif
  95. }
  96. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance, blockSize)
  97. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance, int blockSize)
  98. {
  99. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  100. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_15 (maxCorners, qualityLevel, minDistance, blockSize));
  101. return retVal;
  102. #else
  103. return null;
  104. #endif
  105. }
  106. //javadoc: GFTTDetector::create(maxCorners, qualityLevel, minDistance)
  107. public static GFTTDetector create (int maxCorners, double qualityLevel, double minDistance)
  108. {
  109. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  110. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_16 (maxCorners, qualityLevel, minDistance));
  111. return retVal;
  112. #else
  113. return null;
  114. #endif
  115. }
  116. //javadoc: GFTTDetector::create(maxCorners, qualityLevel)
  117. public static GFTTDetector create (int maxCorners, double qualityLevel)
  118. {
  119. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  120. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_17 (maxCorners, qualityLevel));
  121. return retVal;
  122. #else
  123. return null;
  124. #endif
  125. }
  126. //javadoc: GFTTDetector::create(maxCorners)
  127. public static GFTTDetector create (int maxCorners)
  128. {
  129. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  130. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_18 (maxCorners));
  131. return retVal;
  132. #else
  133. return null;
  134. #endif
  135. }
  136. //javadoc: GFTTDetector::create()
  137. public static GFTTDetector create ()
  138. {
  139. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  140. GFTTDetector retVal = GFTTDetector.__fromPtr__ (features2d_GFTTDetector_create_19 ());
  141. return retVal;
  142. #else
  143. return null;
  144. #endif
  145. }
  146. //
  147. // C++: String cv::GFTTDetector::getDefaultName()
  148. //
  149. //javadoc: GFTTDetector::getDefaultName()
  150. public override string getDefaultName ()
  151. {
  152. ThrowIfDisposed ();
  153. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  154. string retVal = Marshal.PtrToStringAnsi (features2d_GFTTDetector_getDefaultName_10 (nativeObj));
  155. return retVal;
  156. #else
  157. return null;
  158. #endif
  159. }
  160. //
  161. // C++: bool cv::GFTTDetector::getHarrisDetector()
  162. //
  163. //javadoc: GFTTDetector::getHarrisDetector()
  164. public bool getHarrisDetector ()
  165. {
  166. ThrowIfDisposed ();
  167. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  168. bool retVal = features2d_GFTTDetector_getHarrisDetector_10 (nativeObj);
  169. return retVal;
  170. #else
  171. return false;
  172. #endif
  173. }
  174. //
  175. // C++: double cv::GFTTDetector::getK()
  176. //
  177. //javadoc: GFTTDetector::getK()
  178. public double getK ()
  179. {
  180. ThrowIfDisposed ();
  181. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  182. double retVal = features2d_GFTTDetector_getK_10 (nativeObj);
  183. return retVal;
  184. #else
  185. return -1;
  186. #endif
  187. }
  188. //
  189. // C++: double cv::GFTTDetector::getMinDistance()
  190. //
  191. //javadoc: GFTTDetector::getMinDistance()
  192. public double getMinDistance ()
  193. {
  194. ThrowIfDisposed ();
  195. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  196. double retVal = features2d_GFTTDetector_getMinDistance_10 (nativeObj);
  197. return retVal;
  198. #else
  199. return -1;
  200. #endif
  201. }
  202. //
  203. // C++: double cv::GFTTDetector::getQualityLevel()
  204. //
  205. //javadoc: GFTTDetector::getQualityLevel()
  206. public double getQualityLevel ()
  207. {
  208. ThrowIfDisposed ();
  209. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  210. double retVal = features2d_GFTTDetector_getQualityLevel_10 (nativeObj);
  211. return retVal;
  212. #else
  213. return -1;
  214. #endif
  215. }
  216. //
  217. // C++: int cv::GFTTDetector::getBlockSize()
  218. //
  219. //javadoc: GFTTDetector::getBlockSize()
  220. public int getBlockSize ()
  221. {
  222. ThrowIfDisposed ();
  223. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  224. int retVal = features2d_GFTTDetector_getBlockSize_10 (nativeObj);
  225. return retVal;
  226. #else
  227. return -1;
  228. #endif
  229. }
  230. //
  231. // C++: int cv::GFTTDetector::getMaxFeatures()
  232. //
  233. //javadoc: GFTTDetector::getMaxFeatures()
  234. public int getMaxFeatures ()
  235. {
  236. ThrowIfDisposed ();
  237. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  238. int retVal = features2d_GFTTDetector_getMaxFeatures_10 (nativeObj);
  239. return retVal;
  240. #else
  241. return -1;
  242. #endif
  243. }
  244. //
  245. // C++: void cv::GFTTDetector::setBlockSize(int blockSize)
  246. //
  247. //javadoc: GFTTDetector::setBlockSize(blockSize)
  248. public void setBlockSize (int blockSize)
  249. {
  250. ThrowIfDisposed ();
  251. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  252. features2d_GFTTDetector_setBlockSize_10 (nativeObj, blockSize);
  253. return;
  254. #else
  255. return;
  256. #endif
  257. }
  258. //
  259. // C++: void cv::GFTTDetector::setHarrisDetector(bool val)
  260. //
  261. //javadoc: GFTTDetector::setHarrisDetector(val)
  262. public void setHarrisDetector (bool val)
  263. {
  264. ThrowIfDisposed ();
  265. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  266. features2d_GFTTDetector_setHarrisDetector_10 (nativeObj, val);
  267. return;
  268. #else
  269. return;
  270. #endif
  271. }
  272. //
  273. // C++: void cv::GFTTDetector::setK(double k)
  274. //
  275. //javadoc: GFTTDetector::setK(k)
  276. public void setK (double k)
  277. {
  278. ThrowIfDisposed ();
  279. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  280. features2d_GFTTDetector_setK_10 (nativeObj, k);
  281. return;
  282. #else
  283. return;
  284. #endif
  285. }
  286. //
  287. // C++: void cv::GFTTDetector::setMaxFeatures(int maxFeatures)
  288. //
  289. //javadoc: GFTTDetector::setMaxFeatures(maxFeatures)
  290. public void setMaxFeatures (int maxFeatures)
  291. {
  292. ThrowIfDisposed ();
  293. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  294. features2d_GFTTDetector_setMaxFeatures_10 (nativeObj, maxFeatures);
  295. return;
  296. #else
  297. return;
  298. #endif
  299. }
  300. //
  301. // C++: void cv::GFTTDetector::setMinDistance(double minDistance)
  302. //
  303. //javadoc: GFTTDetector::setMinDistance(minDistance)
  304. public void setMinDistance (double minDistance)
  305. {
  306. ThrowIfDisposed ();
  307. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  308. features2d_GFTTDetector_setMinDistance_10 (nativeObj, minDistance);
  309. return;
  310. #else
  311. return;
  312. #endif
  313. }
  314. //
  315. // C++: void cv::GFTTDetector::setQualityLevel(double qlevel)
  316. //
  317. //javadoc: GFTTDetector::setQualityLevel(qlevel)
  318. public void setQualityLevel (double qlevel)
  319. {
  320. ThrowIfDisposed ();
  321. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  322. features2d_GFTTDetector_setQualityLevel_10 (nativeObj, qlevel);
  323. return;
  324. #else
  325. return;
  326. #endif
  327. }
  328. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  329. const string LIBNAME = "__Internal";
  330. #else
  331. const string LIBNAME = "opencvforunity";
  332. #endif
  333. // C++: static Ptr_GFTTDetector cv::GFTTDetector::create(int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector = false, double k = 0.04)
  334. [DllImport (LIBNAME)]
  335. private static extern IntPtr features2d_GFTTDetector_create_10 (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector, double k);
  336. [DllImport (LIBNAME)]
  337. private static extern IntPtr features2d_GFTTDetector_create_11 (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize, bool useHarrisDetector);
  338. [DllImport (LIBNAME)]
  339. private static extern IntPtr features2d_GFTTDetector_create_12 (int maxCorners, double qualityLevel, double minDistance, int blockSize, int gradiantSize);
  340. // C++: static Ptr_GFTTDetector cv::GFTTDetector::create(int maxCorners = 1000, double qualityLevel = 0.01, double minDistance = 1, int blockSize = 3, bool useHarrisDetector = false, double k = 0.04)
  341. [DllImport (LIBNAME)]
  342. private static extern IntPtr features2d_GFTTDetector_create_13 (int maxCorners, double qualityLevel, double minDistance, int blockSize, bool useHarrisDetector, double k);
  343. [DllImport (LIBNAME)]
  344. private static extern IntPtr features2d_GFTTDetector_create_14 (int maxCorners, double qualityLevel, double minDistance, int blockSize, bool useHarrisDetector);
  345. [DllImport (LIBNAME)]
  346. private static extern IntPtr features2d_GFTTDetector_create_15 (int maxCorners, double qualityLevel, double minDistance, int blockSize);
  347. [DllImport (LIBNAME)]
  348. private static extern IntPtr features2d_GFTTDetector_create_16 (int maxCorners, double qualityLevel, double minDistance);
  349. [DllImport (LIBNAME)]
  350. private static extern IntPtr features2d_GFTTDetector_create_17 (int maxCorners, double qualityLevel);
  351. [DllImport (LIBNAME)]
  352. private static extern IntPtr features2d_GFTTDetector_create_18 (int maxCorners);
  353. [DllImport (LIBNAME)]
  354. private static extern IntPtr features2d_GFTTDetector_create_19 ();
  355. // C++: String cv::GFTTDetector::getDefaultName()
  356. [DllImport (LIBNAME)]
  357. private static extern IntPtr features2d_GFTTDetector_getDefaultName_10 (IntPtr nativeObj);
  358. // C++: bool cv::GFTTDetector::getHarrisDetector()
  359. [DllImport (LIBNAME)]
  360. private static extern bool features2d_GFTTDetector_getHarrisDetector_10 (IntPtr nativeObj);
  361. // C++: double cv::GFTTDetector::getK()
  362. [DllImport (LIBNAME)]
  363. private static extern double features2d_GFTTDetector_getK_10 (IntPtr nativeObj);
  364. // C++: double cv::GFTTDetector::getMinDistance()
  365. [DllImport (LIBNAME)]
  366. private static extern double features2d_GFTTDetector_getMinDistance_10 (IntPtr nativeObj);
  367. // C++: double cv::GFTTDetector::getQualityLevel()
  368. [DllImport (LIBNAME)]
  369. private static extern double features2d_GFTTDetector_getQualityLevel_10 (IntPtr nativeObj);
  370. // C++: int cv::GFTTDetector::getBlockSize()
  371. [DllImport (LIBNAME)]
  372. private static extern int features2d_GFTTDetector_getBlockSize_10 (IntPtr nativeObj);
  373. // C++: int cv::GFTTDetector::getMaxFeatures()
  374. [DllImport (LIBNAME)]
  375. private static extern int features2d_GFTTDetector_getMaxFeatures_10 (IntPtr nativeObj);
  376. // C++: void cv::GFTTDetector::setBlockSize(int blockSize)
  377. [DllImport (LIBNAME)]
  378. private static extern void features2d_GFTTDetector_setBlockSize_10 (IntPtr nativeObj, int blockSize);
  379. // C++: void cv::GFTTDetector::setHarrisDetector(bool val)
  380. [DllImport (LIBNAME)]
  381. private static extern void features2d_GFTTDetector_setHarrisDetector_10 (IntPtr nativeObj, bool val);
  382. // C++: void cv::GFTTDetector::setK(double k)
  383. [DllImport (LIBNAME)]
  384. private static extern void features2d_GFTTDetector_setK_10 (IntPtr nativeObj, double k);
  385. // C++: void cv::GFTTDetector::setMaxFeatures(int maxFeatures)
  386. [DllImport (LIBNAME)]
  387. private static extern void features2d_GFTTDetector_setMaxFeatures_10 (IntPtr nativeObj, int maxFeatures);
  388. // C++: void cv::GFTTDetector::setMinDistance(double minDistance)
  389. [DllImport (LIBNAME)]
  390. private static extern void features2d_GFTTDetector_setMinDistance_10 (IntPtr nativeObj, double minDistance);
  391. // C++: void cv::GFTTDetector::setQualityLevel(double qlevel)
  392. [DllImport (LIBNAME)]
  393. private static extern void features2d_GFTTDetector_setQualityLevel_10 (IntPtr nativeObj, double qlevel);
  394. // native support for java finalize()
  395. [DllImport (LIBNAME)]
  396. private static extern void features2d_GFTTDetector_delete (IntPtr nativeObj);
  397. }
  398. }