SelectiveSearchSegmentation.cs 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440
  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.XimgprocModule
  8. {
  9. // C++: class SelectiveSearchSegmentation
  10. //javadoc: SelectiveSearchSegmentation
  11. public class SelectiveSearchSegmentation : Algorithm
  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. ximgproc_SelectiveSearchSegmentation_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal SelectiveSearchSegmentation (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new SelectiveSearchSegmentation __fromPtr__ (IntPtr addr) { return new SelectiveSearchSegmentation (addr); }
  34. //
  35. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addGraphSegmentation(Ptr_GraphSegmentation g)
  36. //
  37. //javadoc: SelectiveSearchSegmentation::addGraphSegmentation(g)
  38. public void addGraphSegmentation (GraphSegmentation g)
  39. {
  40. ThrowIfDisposed ();
  41. if (g != null) g.ThrowIfDisposed ();
  42. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  43. ximgproc_SelectiveSearchSegmentation_addGraphSegmentation_10(nativeObj, g.getNativeObjAddr());
  44. return;
  45. #else
  46. return;
  47. #endif
  48. }
  49. //
  50. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addImage(Mat img)
  51. //
  52. //javadoc: SelectiveSearchSegmentation::addImage(img)
  53. public void addImage (Mat img)
  54. {
  55. ThrowIfDisposed ();
  56. if (img != null) img.ThrowIfDisposed ();
  57. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  58. ximgproc_SelectiveSearchSegmentation_addImage_10(nativeObj, img.nativeObj);
  59. return;
  60. #else
  61. return;
  62. #endif
  63. }
  64. //
  65. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addStrategy(Ptr_SelectiveSearchSegmentationStrategy s)
  66. //
  67. //javadoc: SelectiveSearchSegmentation::addStrategy(s)
  68. public void addStrategy (SelectiveSearchSegmentationStrategy s)
  69. {
  70. ThrowIfDisposed ();
  71. if (s != null) s.ThrowIfDisposed ();
  72. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  73. ximgproc_SelectiveSearchSegmentation_addStrategy_10(nativeObj, s.getNativeObjAddr());
  74. return;
  75. #else
  76. return;
  77. #endif
  78. }
  79. //
  80. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearGraphSegmentations()
  81. //
  82. //javadoc: SelectiveSearchSegmentation::clearGraphSegmentations()
  83. public void clearGraphSegmentations ()
  84. {
  85. ThrowIfDisposed ();
  86. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  87. ximgproc_SelectiveSearchSegmentation_clearGraphSegmentations_10(nativeObj);
  88. return;
  89. #else
  90. return;
  91. #endif
  92. }
  93. //
  94. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearImages()
  95. //
  96. //javadoc: SelectiveSearchSegmentation::clearImages()
  97. public void clearImages ()
  98. {
  99. ThrowIfDisposed ();
  100. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  101. ximgproc_SelectiveSearchSegmentation_clearImages_10(nativeObj);
  102. return;
  103. #else
  104. return;
  105. #endif
  106. }
  107. //
  108. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearStrategies()
  109. //
  110. //javadoc: SelectiveSearchSegmentation::clearStrategies()
  111. public void clearStrategies ()
  112. {
  113. ThrowIfDisposed ();
  114. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  115. ximgproc_SelectiveSearchSegmentation_clearStrategies_10(nativeObj);
  116. return;
  117. #else
  118. return;
  119. #endif
  120. }
  121. //
  122. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::process(vector_Rect& rects)
  123. //
  124. //javadoc: SelectiveSearchSegmentation::process(rects)
  125. public void process (MatOfRect rects)
  126. {
  127. ThrowIfDisposed ();
  128. if (rects != null) rects.ThrowIfDisposed ();
  129. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  130. Mat rects_mat = rects;
  131. ximgproc_SelectiveSearchSegmentation_process_10(nativeObj, rects_mat.nativeObj);
  132. return;
  133. #else
  134. return;
  135. #endif
  136. }
  137. //
  138. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::setBaseImage(Mat img)
  139. //
  140. //javadoc: SelectiveSearchSegmentation::setBaseImage(img)
  141. public void setBaseImage (Mat img)
  142. {
  143. ThrowIfDisposed ();
  144. if (img != null) img.ThrowIfDisposed ();
  145. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  146. ximgproc_SelectiveSearchSegmentation_setBaseImage_10(nativeObj, img.nativeObj);
  147. return;
  148. #else
  149. return;
  150. #endif
  151. }
  152. //
  153. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8f)
  154. //
  155. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchFast(base_k, inc_k, sigma)
  156. public void switchToSelectiveSearchFast (int base_k, int inc_k, float sigma)
  157. {
  158. ThrowIfDisposed ();
  159. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  160. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_10(nativeObj, base_k, inc_k, sigma);
  161. return;
  162. #else
  163. return;
  164. #endif
  165. }
  166. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchFast(base_k, inc_k)
  167. public void switchToSelectiveSearchFast (int base_k, int inc_k)
  168. {
  169. ThrowIfDisposed ();
  170. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  171. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_11(nativeObj, base_k, inc_k);
  172. return;
  173. #else
  174. return;
  175. #endif
  176. }
  177. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchFast(base_k)
  178. public void switchToSelectiveSearchFast (int base_k)
  179. {
  180. ThrowIfDisposed ();
  181. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  182. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_12(nativeObj, base_k);
  183. return;
  184. #else
  185. return;
  186. #endif
  187. }
  188. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchFast()
  189. public void switchToSelectiveSearchFast ()
  190. {
  191. ThrowIfDisposed ();
  192. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  193. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_13(nativeObj);
  194. return;
  195. #else
  196. return;
  197. #endif
  198. }
  199. //
  200. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8f)
  201. //
  202. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchQuality(base_k, inc_k, sigma)
  203. public void switchToSelectiveSearchQuality (int base_k, int inc_k, float sigma)
  204. {
  205. ThrowIfDisposed ();
  206. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  207. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_10(nativeObj, base_k, inc_k, sigma);
  208. return;
  209. #else
  210. return;
  211. #endif
  212. }
  213. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchQuality(base_k, inc_k)
  214. public void switchToSelectiveSearchQuality (int base_k, int inc_k)
  215. {
  216. ThrowIfDisposed ();
  217. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  218. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_11(nativeObj, base_k, inc_k);
  219. return;
  220. #else
  221. return;
  222. #endif
  223. }
  224. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchQuality(base_k)
  225. public void switchToSelectiveSearchQuality (int base_k)
  226. {
  227. ThrowIfDisposed ();
  228. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  229. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_12(nativeObj, base_k);
  230. return;
  231. #else
  232. return;
  233. #endif
  234. }
  235. //javadoc: SelectiveSearchSegmentation::switchToSelectiveSearchQuality()
  236. public void switchToSelectiveSearchQuality ()
  237. {
  238. ThrowIfDisposed ();
  239. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  240. ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_13(nativeObj);
  241. return;
  242. #else
  243. return;
  244. #endif
  245. }
  246. //
  247. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSingleStrategy(int k = 200, float sigma = 0.8f)
  248. //
  249. //javadoc: SelectiveSearchSegmentation::switchToSingleStrategy(k, sigma)
  250. public void switchToSingleStrategy (int k, float sigma)
  251. {
  252. ThrowIfDisposed ();
  253. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  254. ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_10(nativeObj, k, sigma);
  255. return;
  256. #else
  257. return;
  258. #endif
  259. }
  260. //javadoc: SelectiveSearchSegmentation::switchToSingleStrategy(k)
  261. public void switchToSingleStrategy (int k)
  262. {
  263. ThrowIfDisposed ();
  264. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  265. ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_11(nativeObj, k);
  266. return;
  267. #else
  268. return;
  269. #endif
  270. }
  271. //javadoc: SelectiveSearchSegmentation::switchToSingleStrategy()
  272. public void switchToSingleStrategy ()
  273. {
  274. ThrowIfDisposed ();
  275. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  276. ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_12(nativeObj);
  277. return;
  278. #else
  279. return;
  280. #endif
  281. }
  282. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  283. const string LIBNAME = "__Internal";
  284. #else
  285. const string LIBNAME = "opencvforunity";
  286. #endif
  287. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addGraphSegmentation(Ptr_GraphSegmentation g)
  288. [DllImport (LIBNAME)]
  289. private static extern void ximgproc_SelectiveSearchSegmentation_addGraphSegmentation_10 (IntPtr nativeObj, IntPtr g_nativeObj);
  290. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addImage(Mat img)
  291. [DllImport (LIBNAME)]
  292. private static extern void ximgproc_SelectiveSearchSegmentation_addImage_10 (IntPtr nativeObj, IntPtr img_nativeObj);
  293. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::addStrategy(Ptr_SelectiveSearchSegmentationStrategy s)
  294. [DllImport (LIBNAME)]
  295. private static extern void ximgproc_SelectiveSearchSegmentation_addStrategy_10 (IntPtr nativeObj, IntPtr s_nativeObj);
  296. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearGraphSegmentations()
  297. [DllImport (LIBNAME)]
  298. private static extern void ximgproc_SelectiveSearchSegmentation_clearGraphSegmentations_10 (IntPtr nativeObj);
  299. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearImages()
  300. [DllImport (LIBNAME)]
  301. private static extern void ximgproc_SelectiveSearchSegmentation_clearImages_10 (IntPtr nativeObj);
  302. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::clearStrategies()
  303. [DllImport (LIBNAME)]
  304. private static extern void ximgproc_SelectiveSearchSegmentation_clearStrategies_10 (IntPtr nativeObj);
  305. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::process(vector_Rect& rects)
  306. [DllImport (LIBNAME)]
  307. private static extern void ximgproc_SelectiveSearchSegmentation_process_10 (IntPtr nativeObj, IntPtr rects_mat_nativeObj);
  308. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::setBaseImage(Mat img)
  309. [DllImport (LIBNAME)]
  310. private static extern void ximgproc_SelectiveSearchSegmentation_setBaseImage_10 (IntPtr nativeObj, IntPtr img_nativeObj);
  311. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8f)
  312. [DllImport (LIBNAME)]
  313. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_10 (IntPtr nativeObj, int base_k, int inc_k, float sigma);
  314. [DllImport (LIBNAME)]
  315. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_11 (IntPtr nativeObj, int base_k, int inc_k);
  316. [DllImport (LIBNAME)]
  317. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_12 (IntPtr nativeObj, int base_k);
  318. [DllImport (LIBNAME)]
  319. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchFast_13 (IntPtr nativeObj);
  320. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8f)
  321. [DllImport (LIBNAME)]
  322. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_10 (IntPtr nativeObj, int base_k, int inc_k, float sigma);
  323. [DllImport (LIBNAME)]
  324. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_11 (IntPtr nativeObj, int base_k, int inc_k);
  325. [DllImport (LIBNAME)]
  326. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_12 (IntPtr nativeObj, int base_k);
  327. [DllImport (LIBNAME)]
  328. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSelectiveSearchQuality_13 (IntPtr nativeObj);
  329. // C++: void cv::ximgproc::segmentation::SelectiveSearchSegmentation::switchToSingleStrategy(int k = 200, float sigma = 0.8f)
  330. [DllImport (LIBNAME)]
  331. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_10 (IntPtr nativeObj, int k, float sigma);
  332. [DllImport (LIBNAME)]
  333. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_11 (IntPtr nativeObj, int k);
  334. [DllImport (LIBNAME)]
  335. private static extern void ximgproc_SelectiveSearchSegmentation_switchToSingleStrategy_12 (IntPtr nativeObj);
  336. // native support for java finalize()
  337. [DllImport (LIBNAME)]
  338. private static extern void ximgproc_SelectiveSearchSegmentation_delete (IntPtr nativeObj);
  339. }
  340. }