SelectiveSearchSegmentation.cs 14 KB

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