GeneralizedHough.cs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  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.ImgprocModule
  8. {
  9. // C++: class GeneralizedHough
  10. //javadoc: GeneralizedHough
  11. public class GeneralizedHough : 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. imgproc_GeneralizedHough_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. } finally {
  25. base.Dispose (disposing);
  26. }
  27. #else
  28. return;
  29. #endif
  30. }
  31. protected internal GeneralizedHough (IntPtr addr) : base (addr) { }
  32. // internal usage only
  33. public static new GeneralizedHough __fromPtr__ (IntPtr addr) { return new GeneralizedHough (addr); }
  34. //
  35. // C++: double cv::GeneralizedHough::getDp()
  36. //
  37. //javadoc: GeneralizedHough::getDp()
  38. public double getDp ()
  39. {
  40. ThrowIfDisposed ();
  41. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  42. double retVal = imgproc_GeneralizedHough_getDp_10(nativeObj);
  43. return retVal;
  44. #else
  45. return -1;
  46. #endif
  47. }
  48. //
  49. // C++: double cv::GeneralizedHough::getMinDist()
  50. //
  51. //javadoc: GeneralizedHough::getMinDist()
  52. public double getMinDist ()
  53. {
  54. ThrowIfDisposed ();
  55. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  56. double retVal = imgproc_GeneralizedHough_getMinDist_10(nativeObj);
  57. return retVal;
  58. #else
  59. return -1;
  60. #endif
  61. }
  62. //
  63. // C++: int cv::GeneralizedHough::getCannyHighThresh()
  64. //
  65. //javadoc: GeneralizedHough::getCannyHighThresh()
  66. public int getCannyHighThresh ()
  67. {
  68. ThrowIfDisposed ();
  69. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  70. int retVal = imgproc_GeneralizedHough_getCannyHighThresh_10(nativeObj);
  71. return retVal;
  72. #else
  73. return -1;
  74. #endif
  75. }
  76. //
  77. // C++: int cv::GeneralizedHough::getCannyLowThresh()
  78. //
  79. //javadoc: GeneralizedHough::getCannyLowThresh()
  80. public int getCannyLowThresh ()
  81. {
  82. ThrowIfDisposed ();
  83. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  84. int retVal = imgproc_GeneralizedHough_getCannyLowThresh_10(nativeObj);
  85. return retVal;
  86. #else
  87. return -1;
  88. #endif
  89. }
  90. //
  91. // C++: int cv::GeneralizedHough::getMaxBufferSize()
  92. //
  93. //javadoc: GeneralizedHough::getMaxBufferSize()
  94. public int getMaxBufferSize ()
  95. {
  96. ThrowIfDisposed ();
  97. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  98. int retVal = imgproc_GeneralizedHough_getMaxBufferSize_10(nativeObj);
  99. return retVal;
  100. #else
  101. return -1;
  102. #endif
  103. }
  104. //
  105. // C++: void cv::GeneralizedHough::detect(Mat edges, Mat dx, Mat dy, Mat& positions, Mat& votes = Mat())
  106. //
  107. //javadoc: GeneralizedHough::detect(edges, dx, dy, positions, votes)
  108. public void detect (Mat edges, Mat dx, Mat dy, Mat positions, Mat votes)
  109. {
  110. ThrowIfDisposed ();
  111. if (edges != null) edges.ThrowIfDisposed ();
  112. if (dx != null) dx.ThrowIfDisposed ();
  113. if (dy != null) dy.ThrowIfDisposed ();
  114. if (positions != null) positions.ThrowIfDisposed ();
  115. if (votes != null) votes.ThrowIfDisposed ();
  116. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  117. imgproc_GeneralizedHough_detect_10(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, positions.nativeObj, votes.nativeObj);
  118. return;
  119. #else
  120. return;
  121. #endif
  122. }
  123. //javadoc: GeneralizedHough::detect(edges, dx, dy, positions)
  124. public void detect (Mat edges, Mat dx, Mat dy, Mat positions)
  125. {
  126. ThrowIfDisposed ();
  127. if (edges != null) edges.ThrowIfDisposed ();
  128. if (dx != null) dx.ThrowIfDisposed ();
  129. if (dy != null) dy.ThrowIfDisposed ();
  130. if (positions != null) positions.ThrowIfDisposed ();
  131. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  132. imgproc_GeneralizedHough_detect_11(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, positions.nativeObj);
  133. return;
  134. #else
  135. return;
  136. #endif
  137. }
  138. //
  139. // C++: void cv::GeneralizedHough::detect(Mat image, Mat& positions, Mat& votes = Mat())
  140. //
  141. //javadoc: GeneralizedHough::detect(image, positions, votes)
  142. public void detect (Mat image, Mat positions, Mat votes)
  143. {
  144. ThrowIfDisposed ();
  145. if (image != null) image.ThrowIfDisposed ();
  146. if (positions != null) positions.ThrowIfDisposed ();
  147. if (votes != null) votes.ThrowIfDisposed ();
  148. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  149. imgproc_GeneralizedHough_detect_12(nativeObj, image.nativeObj, positions.nativeObj, votes.nativeObj);
  150. return;
  151. #else
  152. return;
  153. #endif
  154. }
  155. //javadoc: GeneralizedHough::detect(image, positions)
  156. public void detect (Mat image, Mat positions)
  157. {
  158. ThrowIfDisposed ();
  159. if (image != null) image.ThrowIfDisposed ();
  160. if (positions != null) positions.ThrowIfDisposed ();
  161. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  162. imgproc_GeneralizedHough_detect_13(nativeObj, image.nativeObj, positions.nativeObj);
  163. return;
  164. #else
  165. return;
  166. #endif
  167. }
  168. //
  169. // C++: void cv::GeneralizedHough::setCannyHighThresh(int cannyHighThresh)
  170. //
  171. //javadoc: GeneralizedHough::setCannyHighThresh(cannyHighThresh)
  172. public void setCannyHighThresh (int cannyHighThresh)
  173. {
  174. ThrowIfDisposed ();
  175. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  176. imgproc_GeneralizedHough_setCannyHighThresh_10(nativeObj, cannyHighThresh);
  177. return;
  178. #else
  179. return;
  180. #endif
  181. }
  182. //
  183. // C++: void cv::GeneralizedHough::setCannyLowThresh(int cannyLowThresh)
  184. //
  185. //javadoc: GeneralizedHough::setCannyLowThresh(cannyLowThresh)
  186. public void setCannyLowThresh (int cannyLowThresh)
  187. {
  188. ThrowIfDisposed ();
  189. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  190. imgproc_GeneralizedHough_setCannyLowThresh_10(nativeObj, cannyLowThresh);
  191. return;
  192. #else
  193. return;
  194. #endif
  195. }
  196. //
  197. // C++: void cv::GeneralizedHough::setDp(double dp)
  198. //
  199. //javadoc: GeneralizedHough::setDp(dp)
  200. public void setDp (double dp)
  201. {
  202. ThrowIfDisposed ();
  203. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  204. imgproc_GeneralizedHough_setDp_10(nativeObj, dp);
  205. return;
  206. #else
  207. return;
  208. #endif
  209. }
  210. //
  211. // C++: void cv::GeneralizedHough::setMaxBufferSize(int maxBufferSize)
  212. //
  213. //javadoc: GeneralizedHough::setMaxBufferSize(maxBufferSize)
  214. public void setMaxBufferSize (int maxBufferSize)
  215. {
  216. ThrowIfDisposed ();
  217. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  218. imgproc_GeneralizedHough_setMaxBufferSize_10(nativeObj, maxBufferSize);
  219. return;
  220. #else
  221. return;
  222. #endif
  223. }
  224. //
  225. // C++: void cv::GeneralizedHough::setMinDist(double minDist)
  226. //
  227. //javadoc: GeneralizedHough::setMinDist(minDist)
  228. public void setMinDist (double minDist)
  229. {
  230. ThrowIfDisposed ();
  231. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  232. imgproc_GeneralizedHough_setMinDist_10(nativeObj, minDist);
  233. return;
  234. #else
  235. return;
  236. #endif
  237. }
  238. //
  239. // C++: void cv::GeneralizedHough::setTemplate(Mat edges, Mat dx, Mat dy, Point templCenter = Point(-1, -1))
  240. //
  241. //javadoc: GeneralizedHough::setTemplate(edges, dx, dy, templCenter)
  242. public void setTemplate (Mat edges, Mat dx, Mat dy, Point templCenter)
  243. {
  244. ThrowIfDisposed ();
  245. if (edges != null) edges.ThrowIfDisposed ();
  246. if (dx != null) dx.ThrowIfDisposed ();
  247. if (dy != null) dy.ThrowIfDisposed ();
  248. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  249. imgproc_GeneralizedHough_setTemplate_10(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj, templCenter.x, templCenter.y);
  250. return;
  251. #else
  252. return;
  253. #endif
  254. }
  255. //javadoc: GeneralizedHough::setTemplate(edges, dx, dy)
  256. public void setTemplate (Mat edges, Mat dx, Mat dy)
  257. {
  258. ThrowIfDisposed ();
  259. if (edges != null) edges.ThrowIfDisposed ();
  260. if (dx != null) dx.ThrowIfDisposed ();
  261. if (dy != null) dy.ThrowIfDisposed ();
  262. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  263. imgproc_GeneralizedHough_setTemplate_11(nativeObj, edges.nativeObj, dx.nativeObj, dy.nativeObj);
  264. return;
  265. #else
  266. return;
  267. #endif
  268. }
  269. //
  270. // C++: void cv::GeneralizedHough::setTemplate(Mat templ, Point templCenter = Point(-1, -1))
  271. //
  272. //javadoc: GeneralizedHough::setTemplate(templ, templCenter)
  273. public void setTemplate (Mat templ, Point templCenter)
  274. {
  275. ThrowIfDisposed ();
  276. if (templ != null) templ.ThrowIfDisposed ();
  277. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  278. imgproc_GeneralizedHough_setTemplate_12(nativeObj, templ.nativeObj, templCenter.x, templCenter.y);
  279. return;
  280. #else
  281. return;
  282. #endif
  283. }
  284. //javadoc: GeneralizedHough::setTemplate(templ)
  285. public void setTemplate (Mat templ)
  286. {
  287. ThrowIfDisposed ();
  288. if (templ != null) templ.ThrowIfDisposed ();
  289. #if ((UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR) || UNITY_5 || UNITY_5_3_OR_NEWER
  290. imgproc_GeneralizedHough_setTemplate_13(nativeObj, templ.nativeObj);
  291. return;
  292. #else
  293. return;
  294. #endif
  295. }
  296. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  297. const string LIBNAME = "__Internal";
  298. #else
  299. const string LIBNAME = "opencvforunity";
  300. #endif
  301. // C++: double cv::GeneralizedHough::getDp()
  302. [DllImport (LIBNAME)]
  303. private static extern double imgproc_GeneralizedHough_getDp_10 (IntPtr nativeObj);
  304. // C++: double cv::GeneralizedHough::getMinDist()
  305. [DllImport (LIBNAME)]
  306. private static extern double imgproc_GeneralizedHough_getMinDist_10 (IntPtr nativeObj);
  307. // C++: int cv::GeneralizedHough::getCannyHighThresh()
  308. [DllImport (LIBNAME)]
  309. private static extern int imgproc_GeneralizedHough_getCannyHighThresh_10 (IntPtr nativeObj);
  310. // C++: int cv::GeneralizedHough::getCannyLowThresh()
  311. [DllImport (LIBNAME)]
  312. private static extern int imgproc_GeneralizedHough_getCannyLowThresh_10 (IntPtr nativeObj);
  313. // C++: int cv::GeneralizedHough::getMaxBufferSize()
  314. [DllImport (LIBNAME)]
  315. private static extern int imgproc_GeneralizedHough_getMaxBufferSize_10 (IntPtr nativeObj);
  316. // C++: void cv::GeneralizedHough::detect(Mat edges, Mat dx, Mat dy, Mat& positions, Mat& votes = Mat())
  317. [DllImport (LIBNAME)]
  318. private static extern void imgproc_GeneralizedHough_detect_10 (IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, IntPtr positions_nativeObj, IntPtr votes_nativeObj);
  319. [DllImport (LIBNAME)]
  320. private static extern void imgproc_GeneralizedHough_detect_11 (IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, IntPtr positions_nativeObj);
  321. // C++: void cv::GeneralizedHough::detect(Mat image, Mat& positions, Mat& votes = Mat())
  322. [DllImport (LIBNAME)]
  323. private static extern void imgproc_GeneralizedHough_detect_12 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr positions_nativeObj, IntPtr votes_nativeObj);
  324. [DllImport (LIBNAME)]
  325. private static extern void imgproc_GeneralizedHough_detect_13 (IntPtr nativeObj, IntPtr image_nativeObj, IntPtr positions_nativeObj);
  326. // C++: void cv::GeneralizedHough::setCannyHighThresh(int cannyHighThresh)
  327. [DllImport (LIBNAME)]
  328. private static extern void imgproc_GeneralizedHough_setCannyHighThresh_10 (IntPtr nativeObj, int cannyHighThresh);
  329. // C++: void cv::GeneralizedHough::setCannyLowThresh(int cannyLowThresh)
  330. [DllImport (LIBNAME)]
  331. private static extern void imgproc_GeneralizedHough_setCannyLowThresh_10 (IntPtr nativeObj, int cannyLowThresh);
  332. // C++: void cv::GeneralizedHough::setDp(double dp)
  333. [DllImport (LIBNAME)]
  334. private static extern void imgproc_GeneralizedHough_setDp_10 (IntPtr nativeObj, double dp);
  335. // C++: void cv::GeneralizedHough::setMaxBufferSize(int maxBufferSize)
  336. [DllImport (LIBNAME)]
  337. private static extern void imgproc_GeneralizedHough_setMaxBufferSize_10 (IntPtr nativeObj, int maxBufferSize);
  338. // C++: void cv::GeneralizedHough::setMinDist(double minDist)
  339. [DllImport (LIBNAME)]
  340. private static extern void imgproc_GeneralizedHough_setMinDist_10 (IntPtr nativeObj, double minDist);
  341. // C++: void cv::GeneralizedHough::setTemplate(Mat edges, Mat dx, Mat dy, Point templCenter = Point(-1, -1))
  342. [DllImport (LIBNAME)]
  343. private static extern void imgproc_GeneralizedHough_setTemplate_10 (IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj, double templCenter_x, double templCenter_y);
  344. [DllImport (LIBNAME)]
  345. private static extern void imgproc_GeneralizedHough_setTemplate_11 (IntPtr nativeObj, IntPtr edges_nativeObj, IntPtr dx_nativeObj, IntPtr dy_nativeObj);
  346. // C++: void cv::GeneralizedHough::setTemplate(Mat templ, Point templCenter = Point(-1, -1))
  347. [DllImport (LIBNAME)]
  348. private static extern void imgproc_GeneralizedHough_setTemplate_12 (IntPtr nativeObj, IntPtr templ_nativeObj, double templCenter_x, double templCenter_y);
  349. [DllImport (LIBNAME)]
  350. private static extern void imgproc_GeneralizedHough_setTemplate_13 (IntPtr nativeObj, IntPtr templ_nativeObj);
  351. // native support for java finalize()
  352. [DllImport (LIBNAME)]
  353. private static extern void imgproc_GeneralizedHough_delete (IntPtr nativeObj);
  354. }
  355. }