EdgeBoxes.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.XimgprocModule
  7. {
  8. // C++: class EdgeBoxes
  9. /**
  10. * Class implementing EdgeBoxes algorithm from CITE: ZitnickECCV14edgeBoxes :
  11. */
  12. public class EdgeBoxes : Algorithm
  13. {
  14. protected override void Dispose(bool disposing)
  15. {
  16. try
  17. {
  18. if (disposing)
  19. {
  20. }
  21. if (IsEnabledDispose)
  22. {
  23. if (nativeObj != IntPtr.Zero)
  24. ximgproc_EdgeBoxes_delete(nativeObj);
  25. nativeObj = IntPtr.Zero;
  26. }
  27. }
  28. finally
  29. {
  30. base.Dispose(disposing);
  31. }
  32. }
  33. protected internal EdgeBoxes(IntPtr addr) : base(addr) { }
  34. // internal usage only
  35. public static new EdgeBoxes __fromPtr__(IntPtr addr) { return new EdgeBoxes(addr); }
  36. //
  37. // C++: void cv::ximgproc::EdgeBoxes::getBoundingBoxes(Mat edge_map, Mat orientation_map, vector_Rect& boxes, Mat& scores = Mat())
  38. //
  39. /**
  40. * Returns array containing proposal boxes.
  41. *
  42. * param edge_map edge image.
  43. * param orientation_map orientation map.
  44. * param boxes proposal boxes.
  45. * param scores of the proposal boxes, provided a vector of float types.
  46. */
  47. public void getBoundingBoxes(Mat edge_map, Mat orientation_map, MatOfRect boxes, Mat scores)
  48. {
  49. ThrowIfDisposed();
  50. if (edge_map != null) edge_map.ThrowIfDisposed();
  51. if (orientation_map != null) orientation_map.ThrowIfDisposed();
  52. if (boxes != null) boxes.ThrowIfDisposed();
  53. if (scores != null) scores.ThrowIfDisposed();
  54. Mat boxes_mat = boxes;
  55. ximgproc_EdgeBoxes_getBoundingBoxes_10(nativeObj, edge_map.nativeObj, orientation_map.nativeObj, boxes_mat.nativeObj, scores.nativeObj);
  56. }
  57. /**
  58. * Returns array containing proposal boxes.
  59. *
  60. * param edge_map edge image.
  61. * param orientation_map orientation map.
  62. * param boxes proposal boxes.
  63. */
  64. public void getBoundingBoxes(Mat edge_map, Mat orientation_map, MatOfRect boxes)
  65. {
  66. ThrowIfDisposed();
  67. if (edge_map != null) edge_map.ThrowIfDisposed();
  68. if (orientation_map != null) orientation_map.ThrowIfDisposed();
  69. if (boxes != null) boxes.ThrowIfDisposed();
  70. Mat boxes_mat = boxes;
  71. ximgproc_EdgeBoxes_getBoundingBoxes_11(nativeObj, edge_map.nativeObj, orientation_map.nativeObj, boxes_mat.nativeObj);
  72. }
  73. //
  74. // C++: float cv::ximgproc::EdgeBoxes::getAlpha()
  75. //
  76. /**
  77. * Returns the step size of sliding window search.
  78. * return automatically generated
  79. */
  80. public float getAlpha()
  81. {
  82. ThrowIfDisposed();
  83. return ximgproc_EdgeBoxes_getAlpha_10(nativeObj);
  84. }
  85. //
  86. // C++: void cv::ximgproc::EdgeBoxes::setAlpha(float value)
  87. //
  88. /**
  89. * Sets the step size of sliding window search.
  90. * param value automatically generated
  91. */
  92. public void setAlpha(float value)
  93. {
  94. ThrowIfDisposed();
  95. ximgproc_EdgeBoxes_setAlpha_10(nativeObj, value);
  96. }
  97. //
  98. // C++: float cv::ximgproc::EdgeBoxes::getBeta()
  99. //
  100. /**
  101. * Returns the nms threshold for object proposals.
  102. * return automatically generated
  103. */
  104. public float getBeta()
  105. {
  106. ThrowIfDisposed();
  107. return ximgproc_EdgeBoxes_getBeta_10(nativeObj);
  108. }
  109. //
  110. // C++: void cv::ximgproc::EdgeBoxes::setBeta(float value)
  111. //
  112. /**
  113. * Sets the nms threshold for object proposals.
  114. * param value automatically generated
  115. */
  116. public void setBeta(float value)
  117. {
  118. ThrowIfDisposed();
  119. ximgproc_EdgeBoxes_setBeta_10(nativeObj, value);
  120. }
  121. //
  122. // C++: float cv::ximgproc::EdgeBoxes::getEta()
  123. //
  124. /**
  125. * Returns adaptation rate for nms threshold.
  126. * return automatically generated
  127. */
  128. public float getEta()
  129. {
  130. ThrowIfDisposed();
  131. return ximgproc_EdgeBoxes_getEta_10(nativeObj);
  132. }
  133. //
  134. // C++: void cv::ximgproc::EdgeBoxes::setEta(float value)
  135. //
  136. /**
  137. * Sets the adaptation rate for nms threshold.
  138. * param value automatically generated
  139. */
  140. public void setEta(float value)
  141. {
  142. ThrowIfDisposed();
  143. ximgproc_EdgeBoxes_setEta_10(nativeObj, value);
  144. }
  145. //
  146. // C++: float cv::ximgproc::EdgeBoxes::getMinScore()
  147. //
  148. /**
  149. * Returns the min score of boxes to detect.
  150. * return automatically generated
  151. */
  152. public float getMinScore()
  153. {
  154. ThrowIfDisposed();
  155. return ximgproc_EdgeBoxes_getMinScore_10(nativeObj);
  156. }
  157. //
  158. // C++: void cv::ximgproc::EdgeBoxes::setMinScore(float value)
  159. //
  160. /**
  161. * Sets the min score of boxes to detect.
  162. * param value automatically generated
  163. */
  164. public void setMinScore(float value)
  165. {
  166. ThrowIfDisposed();
  167. ximgproc_EdgeBoxes_setMinScore_10(nativeObj, value);
  168. }
  169. //
  170. // C++: int cv::ximgproc::EdgeBoxes::getMaxBoxes()
  171. //
  172. /**
  173. * Returns the max number of boxes to detect.
  174. * return automatically generated
  175. */
  176. public int getMaxBoxes()
  177. {
  178. ThrowIfDisposed();
  179. return ximgproc_EdgeBoxes_getMaxBoxes_10(nativeObj);
  180. }
  181. //
  182. // C++: void cv::ximgproc::EdgeBoxes::setMaxBoxes(int value)
  183. //
  184. /**
  185. * Sets max number of boxes to detect.
  186. * param value automatically generated
  187. */
  188. public void setMaxBoxes(int value)
  189. {
  190. ThrowIfDisposed();
  191. ximgproc_EdgeBoxes_setMaxBoxes_10(nativeObj, value);
  192. }
  193. //
  194. // C++: float cv::ximgproc::EdgeBoxes::getEdgeMinMag()
  195. //
  196. /**
  197. * Returns the edge min magnitude.
  198. * return automatically generated
  199. */
  200. public float getEdgeMinMag()
  201. {
  202. ThrowIfDisposed();
  203. return ximgproc_EdgeBoxes_getEdgeMinMag_10(nativeObj);
  204. }
  205. //
  206. // C++: void cv::ximgproc::EdgeBoxes::setEdgeMinMag(float value)
  207. //
  208. /**
  209. * Sets the edge min magnitude.
  210. * param value automatically generated
  211. */
  212. public void setEdgeMinMag(float value)
  213. {
  214. ThrowIfDisposed();
  215. ximgproc_EdgeBoxes_setEdgeMinMag_10(nativeObj, value);
  216. }
  217. //
  218. // C++: float cv::ximgproc::EdgeBoxes::getEdgeMergeThr()
  219. //
  220. /**
  221. * Returns the edge merge threshold.
  222. * return automatically generated
  223. */
  224. public float getEdgeMergeThr()
  225. {
  226. ThrowIfDisposed();
  227. return ximgproc_EdgeBoxes_getEdgeMergeThr_10(nativeObj);
  228. }
  229. //
  230. // C++: void cv::ximgproc::EdgeBoxes::setEdgeMergeThr(float value)
  231. //
  232. /**
  233. * Sets the edge merge threshold.
  234. * param value automatically generated
  235. */
  236. public void setEdgeMergeThr(float value)
  237. {
  238. ThrowIfDisposed();
  239. ximgproc_EdgeBoxes_setEdgeMergeThr_10(nativeObj, value);
  240. }
  241. //
  242. // C++: float cv::ximgproc::EdgeBoxes::getClusterMinMag()
  243. //
  244. /**
  245. * Returns the cluster min magnitude.
  246. * return automatically generated
  247. */
  248. public float getClusterMinMag()
  249. {
  250. ThrowIfDisposed();
  251. return ximgproc_EdgeBoxes_getClusterMinMag_10(nativeObj);
  252. }
  253. //
  254. // C++: void cv::ximgproc::EdgeBoxes::setClusterMinMag(float value)
  255. //
  256. /**
  257. * Sets the cluster min magnitude.
  258. * param value automatically generated
  259. */
  260. public void setClusterMinMag(float value)
  261. {
  262. ThrowIfDisposed();
  263. ximgproc_EdgeBoxes_setClusterMinMag_10(nativeObj, value);
  264. }
  265. //
  266. // C++: float cv::ximgproc::EdgeBoxes::getMaxAspectRatio()
  267. //
  268. /**
  269. * Returns the max aspect ratio of boxes.
  270. * return automatically generated
  271. */
  272. public float getMaxAspectRatio()
  273. {
  274. ThrowIfDisposed();
  275. return ximgproc_EdgeBoxes_getMaxAspectRatio_10(nativeObj);
  276. }
  277. //
  278. // C++: void cv::ximgproc::EdgeBoxes::setMaxAspectRatio(float value)
  279. //
  280. /**
  281. * Sets the max aspect ratio of boxes.
  282. * param value automatically generated
  283. */
  284. public void setMaxAspectRatio(float value)
  285. {
  286. ThrowIfDisposed();
  287. ximgproc_EdgeBoxes_setMaxAspectRatio_10(nativeObj, value);
  288. }
  289. //
  290. // C++: float cv::ximgproc::EdgeBoxes::getMinBoxArea()
  291. //
  292. /**
  293. * Returns the minimum area of boxes.
  294. * return automatically generated
  295. */
  296. public float getMinBoxArea()
  297. {
  298. ThrowIfDisposed();
  299. return ximgproc_EdgeBoxes_getMinBoxArea_10(nativeObj);
  300. }
  301. //
  302. // C++: void cv::ximgproc::EdgeBoxes::setMinBoxArea(float value)
  303. //
  304. /**
  305. * Sets the minimum area of boxes.
  306. * param value automatically generated
  307. */
  308. public void setMinBoxArea(float value)
  309. {
  310. ThrowIfDisposed();
  311. ximgproc_EdgeBoxes_setMinBoxArea_10(nativeObj, value);
  312. }
  313. //
  314. // C++: float cv::ximgproc::EdgeBoxes::getGamma()
  315. //
  316. /**
  317. * Returns the affinity sensitivity.
  318. * return automatically generated
  319. */
  320. public float getGamma()
  321. {
  322. ThrowIfDisposed();
  323. return ximgproc_EdgeBoxes_getGamma_10(nativeObj);
  324. }
  325. //
  326. // C++: void cv::ximgproc::EdgeBoxes::setGamma(float value)
  327. //
  328. /**
  329. * Sets the affinity sensitivity
  330. * param value automatically generated
  331. */
  332. public void setGamma(float value)
  333. {
  334. ThrowIfDisposed();
  335. ximgproc_EdgeBoxes_setGamma_10(nativeObj, value);
  336. }
  337. //
  338. // C++: float cv::ximgproc::EdgeBoxes::getKappa()
  339. //
  340. /**
  341. * Returns the scale sensitivity.
  342. * return automatically generated
  343. */
  344. public float getKappa()
  345. {
  346. ThrowIfDisposed();
  347. return ximgproc_EdgeBoxes_getKappa_10(nativeObj);
  348. }
  349. //
  350. // C++: void cv::ximgproc::EdgeBoxes::setKappa(float value)
  351. //
  352. /**
  353. * Sets the scale sensitivity.
  354. * param value automatically generated
  355. */
  356. public void setKappa(float value)
  357. {
  358. ThrowIfDisposed();
  359. ximgproc_EdgeBoxes_setKappa_10(nativeObj, value);
  360. }
  361. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  362. const string LIBNAME = "__Internal";
  363. #else
  364. const string LIBNAME = "opencvforunity";
  365. #endif
  366. // C++: void cv::ximgproc::EdgeBoxes::getBoundingBoxes(Mat edge_map, Mat orientation_map, vector_Rect& boxes, Mat& scores = Mat())
  367. [DllImport(LIBNAME)]
  368. private static extern void ximgproc_EdgeBoxes_getBoundingBoxes_10(IntPtr nativeObj, IntPtr edge_map_nativeObj, IntPtr orientation_map_nativeObj, IntPtr boxes_mat_nativeObj, IntPtr scores_nativeObj);
  369. [DllImport(LIBNAME)]
  370. private static extern void ximgproc_EdgeBoxes_getBoundingBoxes_11(IntPtr nativeObj, IntPtr edge_map_nativeObj, IntPtr orientation_map_nativeObj, IntPtr boxes_mat_nativeObj);
  371. // C++: float cv::ximgproc::EdgeBoxes::getAlpha()
  372. [DllImport(LIBNAME)]
  373. private static extern float ximgproc_EdgeBoxes_getAlpha_10(IntPtr nativeObj);
  374. // C++: void cv::ximgproc::EdgeBoxes::setAlpha(float value)
  375. [DllImport(LIBNAME)]
  376. private static extern void ximgproc_EdgeBoxes_setAlpha_10(IntPtr nativeObj, float value);
  377. // C++: float cv::ximgproc::EdgeBoxes::getBeta()
  378. [DllImport(LIBNAME)]
  379. private static extern float ximgproc_EdgeBoxes_getBeta_10(IntPtr nativeObj);
  380. // C++: void cv::ximgproc::EdgeBoxes::setBeta(float value)
  381. [DllImport(LIBNAME)]
  382. private static extern void ximgproc_EdgeBoxes_setBeta_10(IntPtr nativeObj, float value);
  383. // C++: float cv::ximgproc::EdgeBoxes::getEta()
  384. [DllImport(LIBNAME)]
  385. private static extern float ximgproc_EdgeBoxes_getEta_10(IntPtr nativeObj);
  386. // C++: void cv::ximgproc::EdgeBoxes::setEta(float value)
  387. [DllImport(LIBNAME)]
  388. private static extern void ximgproc_EdgeBoxes_setEta_10(IntPtr nativeObj, float value);
  389. // C++: float cv::ximgproc::EdgeBoxes::getMinScore()
  390. [DllImport(LIBNAME)]
  391. private static extern float ximgproc_EdgeBoxes_getMinScore_10(IntPtr nativeObj);
  392. // C++: void cv::ximgproc::EdgeBoxes::setMinScore(float value)
  393. [DllImport(LIBNAME)]
  394. private static extern void ximgproc_EdgeBoxes_setMinScore_10(IntPtr nativeObj, float value);
  395. // C++: int cv::ximgproc::EdgeBoxes::getMaxBoxes()
  396. [DllImport(LIBNAME)]
  397. private static extern int ximgproc_EdgeBoxes_getMaxBoxes_10(IntPtr nativeObj);
  398. // C++: void cv::ximgproc::EdgeBoxes::setMaxBoxes(int value)
  399. [DllImport(LIBNAME)]
  400. private static extern void ximgproc_EdgeBoxes_setMaxBoxes_10(IntPtr nativeObj, int value);
  401. // C++: float cv::ximgproc::EdgeBoxes::getEdgeMinMag()
  402. [DllImport(LIBNAME)]
  403. private static extern float ximgproc_EdgeBoxes_getEdgeMinMag_10(IntPtr nativeObj);
  404. // C++: void cv::ximgproc::EdgeBoxes::setEdgeMinMag(float value)
  405. [DllImport(LIBNAME)]
  406. private static extern void ximgproc_EdgeBoxes_setEdgeMinMag_10(IntPtr nativeObj, float value);
  407. // C++: float cv::ximgproc::EdgeBoxes::getEdgeMergeThr()
  408. [DllImport(LIBNAME)]
  409. private static extern float ximgproc_EdgeBoxes_getEdgeMergeThr_10(IntPtr nativeObj);
  410. // C++: void cv::ximgproc::EdgeBoxes::setEdgeMergeThr(float value)
  411. [DllImport(LIBNAME)]
  412. private static extern void ximgproc_EdgeBoxes_setEdgeMergeThr_10(IntPtr nativeObj, float value);
  413. // C++: float cv::ximgproc::EdgeBoxes::getClusterMinMag()
  414. [DllImport(LIBNAME)]
  415. private static extern float ximgproc_EdgeBoxes_getClusterMinMag_10(IntPtr nativeObj);
  416. // C++: void cv::ximgproc::EdgeBoxes::setClusterMinMag(float value)
  417. [DllImport(LIBNAME)]
  418. private static extern void ximgproc_EdgeBoxes_setClusterMinMag_10(IntPtr nativeObj, float value);
  419. // C++: float cv::ximgproc::EdgeBoxes::getMaxAspectRatio()
  420. [DllImport(LIBNAME)]
  421. private static extern float ximgproc_EdgeBoxes_getMaxAspectRatio_10(IntPtr nativeObj);
  422. // C++: void cv::ximgproc::EdgeBoxes::setMaxAspectRatio(float value)
  423. [DllImport(LIBNAME)]
  424. private static extern void ximgproc_EdgeBoxes_setMaxAspectRatio_10(IntPtr nativeObj, float value);
  425. // C++: float cv::ximgproc::EdgeBoxes::getMinBoxArea()
  426. [DllImport(LIBNAME)]
  427. private static extern float ximgproc_EdgeBoxes_getMinBoxArea_10(IntPtr nativeObj);
  428. // C++: void cv::ximgproc::EdgeBoxes::setMinBoxArea(float value)
  429. [DllImport(LIBNAME)]
  430. private static extern void ximgproc_EdgeBoxes_setMinBoxArea_10(IntPtr nativeObj, float value);
  431. // C++: float cv::ximgproc::EdgeBoxes::getGamma()
  432. [DllImport(LIBNAME)]
  433. private static extern float ximgproc_EdgeBoxes_getGamma_10(IntPtr nativeObj);
  434. // C++: void cv::ximgproc::EdgeBoxes::setGamma(float value)
  435. [DllImport(LIBNAME)]
  436. private static extern void ximgproc_EdgeBoxes_setGamma_10(IntPtr nativeObj, float value);
  437. // C++: float cv::ximgproc::EdgeBoxes::getKappa()
  438. [DllImport(LIBNAME)]
  439. private static extern float ximgproc_EdgeBoxes_getKappa_10(IntPtr nativeObj);
  440. // C++: void cv::ximgproc::EdgeBoxes::setKappa(float value)
  441. [DllImport(LIBNAME)]
  442. private static extern void ximgproc_EdgeBoxes_setKappa_10(IntPtr nativeObj, float value);
  443. // native support for java finalize()
  444. [DllImport(LIBNAME)]
  445. private static extern void ximgproc_EdgeBoxes_delete(IntPtr nativeObj);
  446. }
  447. }