BRISK.cs 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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 BRISK
  10. //javadoc: BRISK
  11. public class BRISK : 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_BRISK_delete (nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal BRISK (IntPtr addr)
  32. : base (addr)
  33. {
  34. }
  35. // internal usage only
  36. public static new BRISK __fromPtr__ (IntPtr addr)
  37. {
  38. return new BRISK (addr);
  39. }
  40. //
  41. // C++: static Ptr_BRISK cv::BRISK::create(int thresh, int octaves, vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector<int>())
  42. //
  43. //javadoc: BRISK::create(thresh, octaves, radiusList, numberList, dMax, dMin, indexChange)
  44. public static BRISK create (int thresh, int octaves, MatOfFloat radiusList, MatOfInt numberList, float dMax, float dMin, MatOfInt indexChange)
  45. {
  46. if (radiusList != null)
  47. radiusList.ThrowIfDisposed ();
  48. if (numberList != null)
  49. numberList.ThrowIfDisposed ();
  50. if (indexChange != null)
  51. indexChange.ThrowIfDisposed ();
  52. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  53. Mat radiusList_mat = radiusList;
  54. Mat numberList_mat = numberList;
  55. Mat indexChange_mat = indexChange;
  56. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_10 (thresh, octaves, radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax, dMin, indexChange_mat.nativeObj));
  57. return retVal;
  58. #else
  59. return null;
  60. #endif
  61. }
  62. //javadoc: BRISK::create(thresh, octaves, radiusList, numberList, dMax, dMin)
  63. public static BRISK create (int thresh, int octaves, MatOfFloat radiusList, MatOfInt numberList, float dMax, float dMin)
  64. {
  65. if (radiusList != null)
  66. radiusList.ThrowIfDisposed ();
  67. if (numberList != null)
  68. numberList.ThrowIfDisposed ();
  69. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  70. Mat radiusList_mat = radiusList;
  71. Mat numberList_mat = numberList;
  72. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_11 (thresh, octaves, radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax, dMin));
  73. return retVal;
  74. #else
  75. return null;
  76. #endif
  77. }
  78. //javadoc: BRISK::create(thresh, octaves, radiusList, numberList, dMax)
  79. public static BRISK create (int thresh, int octaves, MatOfFloat radiusList, MatOfInt numberList, float dMax)
  80. {
  81. if (radiusList != null)
  82. radiusList.ThrowIfDisposed ();
  83. if (numberList != null)
  84. numberList.ThrowIfDisposed ();
  85. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  86. Mat radiusList_mat = radiusList;
  87. Mat numberList_mat = numberList;
  88. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_12 (thresh, octaves, radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax));
  89. return retVal;
  90. #else
  91. return null;
  92. #endif
  93. }
  94. //javadoc: BRISK::create(thresh, octaves, radiusList, numberList)
  95. public static BRISK create (int thresh, int octaves, MatOfFloat radiusList, MatOfInt numberList)
  96. {
  97. if (radiusList != null)
  98. radiusList.ThrowIfDisposed ();
  99. if (numberList != null)
  100. numberList.ThrowIfDisposed ();
  101. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  102. Mat radiusList_mat = radiusList;
  103. Mat numberList_mat = numberList;
  104. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_13 (thresh, octaves, radiusList_mat.nativeObj, numberList_mat.nativeObj));
  105. return retVal;
  106. #else
  107. return null;
  108. #endif
  109. }
  110. //
  111. // C++: static Ptr_BRISK cv::BRISK::create(int thresh = 30, int octaves = 3, float patternScale = 1.0f)
  112. //
  113. //javadoc: BRISK::create(thresh, octaves, patternScale)
  114. public static BRISK create (int thresh, int octaves, float patternScale)
  115. {
  116. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  117. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_14 (thresh, octaves, patternScale));
  118. return retVal;
  119. #else
  120. return null;
  121. #endif
  122. }
  123. //javadoc: BRISK::create(thresh, octaves)
  124. public static BRISK create (int thresh, int octaves)
  125. {
  126. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  127. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_15 (thresh, octaves));
  128. return retVal;
  129. #else
  130. return null;
  131. #endif
  132. }
  133. //javadoc: BRISK::create(thresh)
  134. public static BRISK create (int thresh)
  135. {
  136. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  137. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_16 (thresh));
  138. return retVal;
  139. #else
  140. return null;
  141. #endif
  142. }
  143. //javadoc: BRISK::create()
  144. public static BRISK create ()
  145. {
  146. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  147. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_17 ());
  148. return retVal;
  149. #else
  150. return null;
  151. #endif
  152. }
  153. //
  154. // C++: static Ptr_BRISK cv::BRISK::create(vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector<int>())
  155. //
  156. //javadoc: BRISK::create(radiusList, numberList, dMax, dMin, indexChange)
  157. public static BRISK create (MatOfFloat radiusList, MatOfInt numberList, float dMax, float dMin, MatOfInt indexChange)
  158. {
  159. if (radiusList != null)
  160. radiusList.ThrowIfDisposed ();
  161. if (numberList != null)
  162. numberList.ThrowIfDisposed ();
  163. if (indexChange != null)
  164. indexChange.ThrowIfDisposed ();
  165. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  166. Mat radiusList_mat = radiusList;
  167. Mat numberList_mat = numberList;
  168. Mat indexChange_mat = indexChange;
  169. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_18 (radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax, dMin, indexChange_mat.nativeObj));
  170. return retVal;
  171. #else
  172. return null;
  173. #endif
  174. }
  175. //javadoc: BRISK::create(radiusList, numberList, dMax, dMin)
  176. public static BRISK create (MatOfFloat radiusList, MatOfInt numberList, float dMax, float dMin)
  177. {
  178. if (radiusList != null)
  179. radiusList.ThrowIfDisposed ();
  180. if (numberList != null)
  181. numberList.ThrowIfDisposed ();
  182. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  183. Mat radiusList_mat = radiusList;
  184. Mat numberList_mat = numberList;
  185. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_19 (radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax, dMin));
  186. return retVal;
  187. #else
  188. return null;
  189. #endif
  190. }
  191. //javadoc: BRISK::create(radiusList, numberList, dMax)
  192. public static BRISK create (MatOfFloat radiusList, MatOfInt numberList, float dMax)
  193. {
  194. if (radiusList != null)
  195. radiusList.ThrowIfDisposed ();
  196. if (numberList != null)
  197. numberList.ThrowIfDisposed ();
  198. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  199. Mat radiusList_mat = radiusList;
  200. Mat numberList_mat = numberList;
  201. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_110 (radiusList_mat.nativeObj, numberList_mat.nativeObj, dMax));
  202. return retVal;
  203. #else
  204. return null;
  205. #endif
  206. }
  207. //javadoc: BRISK::create(radiusList, numberList)
  208. public static BRISK create (MatOfFloat radiusList, MatOfInt numberList)
  209. {
  210. if (radiusList != null)
  211. radiusList.ThrowIfDisposed ();
  212. if (numberList != null)
  213. numberList.ThrowIfDisposed ();
  214. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  215. Mat radiusList_mat = radiusList;
  216. Mat numberList_mat = numberList;
  217. BRISK retVal = BRISK.__fromPtr__ (features2d_BRISK_create_111 (radiusList_mat.nativeObj, numberList_mat.nativeObj));
  218. return retVal;
  219. #else
  220. return null;
  221. #endif
  222. }
  223. //
  224. // C++: String cv::BRISK::getDefaultName()
  225. //
  226. //javadoc: BRISK::getDefaultName()
  227. public override string getDefaultName ()
  228. {
  229. ThrowIfDisposed ();
  230. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  231. string retVal = Marshal.PtrToStringAnsi (features2d_BRISK_getDefaultName_10 (nativeObj));
  232. return retVal;
  233. #else
  234. return null;
  235. #endif
  236. }
  237. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  238. const string LIBNAME = "__Internal";
  239. #else
  240. const string LIBNAME = "opencvforunity";
  241. #endif
  242. // C++: static Ptr_BRISK cv::BRISK::create(int thresh, int octaves, vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector<int>())
  243. [DllImport (LIBNAME)]
  244. private static extern IntPtr features2d_BRISK_create_10 (int thresh, int octaves, IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax, float dMin, IntPtr indexChange_mat_nativeObj);
  245. [DllImport (LIBNAME)]
  246. private static extern IntPtr features2d_BRISK_create_11 (int thresh, int octaves, IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax, float dMin);
  247. [DllImport (LIBNAME)]
  248. private static extern IntPtr features2d_BRISK_create_12 (int thresh, int octaves, IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax);
  249. [DllImport (LIBNAME)]
  250. private static extern IntPtr features2d_BRISK_create_13 (int thresh, int octaves, IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj);
  251. // C++: static Ptr_BRISK cv::BRISK::create(int thresh = 30, int octaves = 3, float patternScale = 1.0f)
  252. [DllImport (LIBNAME)]
  253. private static extern IntPtr features2d_BRISK_create_14 (int thresh, int octaves, float patternScale);
  254. [DllImport (LIBNAME)]
  255. private static extern IntPtr features2d_BRISK_create_15 (int thresh, int octaves);
  256. [DllImport (LIBNAME)]
  257. private static extern IntPtr features2d_BRISK_create_16 (int thresh);
  258. [DllImport (LIBNAME)]
  259. private static extern IntPtr features2d_BRISK_create_17 ();
  260. // C++: static Ptr_BRISK cv::BRISK::create(vector_float radiusList, vector_int numberList, float dMax = 5.85f, float dMin = 8.2f, vector_int indexChange = std::vector<int>())
  261. [DllImport (LIBNAME)]
  262. private static extern IntPtr features2d_BRISK_create_18 (IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax, float dMin, IntPtr indexChange_mat_nativeObj);
  263. [DllImport (LIBNAME)]
  264. private static extern IntPtr features2d_BRISK_create_19 (IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax, float dMin);
  265. [DllImport (LIBNAME)]
  266. private static extern IntPtr features2d_BRISK_create_110 (IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj, float dMax);
  267. [DllImport (LIBNAME)]
  268. private static extern IntPtr features2d_BRISK_create_111 (IntPtr radiusList_mat_nativeObj, IntPtr numberList_mat_nativeObj);
  269. // C++: String cv::BRISK::getDefaultName()
  270. [DllImport (LIBNAME)]
  271. private static extern IntPtr features2d_BRISK_getDefaultName_10 (IntPtr nativeObj);
  272. // native support for java finalize()
  273. [DllImport (LIBNAME)]
  274. private static extern void features2d_BRISK_delete (IntPtr nativeObj);
  275. }
  276. }