Subdiv2D.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.ImgprocModule
  7. {
  8. // C++: class Subdiv2D
  9. public class Subdiv2D : DisposableOpenCVObject
  10. {
  11. protected override void Dispose(bool disposing)
  12. {
  13. try
  14. {
  15. if (disposing)
  16. {
  17. }
  18. if (IsEnabledDispose)
  19. {
  20. if (nativeObj != IntPtr.Zero)
  21. imgproc_Subdiv2D_delete(nativeObj);
  22. nativeObj = IntPtr.Zero;
  23. }
  24. }
  25. finally
  26. {
  27. base.Dispose(disposing);
  28. }
  29. }
  30. protected internal Subdiv2D(IntPtr addr) : base(addr) { }
  31. public IntPtr getNativeObjAddr() { return nativeObj; }
  32. // internal usage only
  33. public static Subdiv2D __fromPtr__(IntPtr addr) { return new Subdiv2D(addr); }
  34. // C++: enum <unnamed>
  35. public const int PTLOC_ERROR = -2;
  36. public const int PTLOC_OUTSIDE_RECT = -1;
  37. public const int PTLOC_INSIDE = 0;
  38. public const int PTLOC_VERTEX = 1;
  39. public const int PTLOC_ON_EDGE = 2;
  40. public const int NEXT_AROUND_ORG = 0x00;
  41. public const int NEXT_AROUND_DST = 0x22;
  42. public const int PREV_AROUND_ORG = 0x11;
  43. public const int PREV_AROUND_DST = 0x33;
  44. public const int NEXT_AROUND_LEFT = 0x13;
  45. public const int NEXT_AROUND_RIGHT = 0x31;
  46. public const int PREV_AROUND_LEFT = 0x20;
  47. public const int PREV_AROUND_RIGHT = 0x02;
  48. //
  49. // C++: cv::Subdiv2D::Subdiv2D()
  50. //
  51. /**
  52. * creates an empty Subdiv2D object.
  53. * To create a new empty Delaunay subdivision you need to use the #initDelaunay function.
  54. */
  55. public Subdiv2D()
  56. {
  57. nativeObj = DisposableObject.ThrowIfNullIntPtr(imgproc_Subdiv2D_Subdiv2D_10());
  58. }
  59. //
  60. // C++: cv::Subdiv2D::Subdiv2D(Rect rect)
  61. //
  62. /**
  63. *
  64. *
  65. * param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.
  66. *
  67. * The function creates an empty Delaunay subdivision where 2D points can be added using the function
  68. * insert() . All of the points to be added must be within the specified rectangle, otherwise a runtime
  69. * error is raised.
  70. */
  71. public Subdiv2D(Rect rect)
  72. {
  73. nativeObj = DisposableObject.ThrowIfNullIntPtr(imgproc_Subdiv2D_Subdiv2D_11(rect.x, rect.y, rect.width, rect.height));
  74. }
  75. //
  76. // C++: void cv::Subdiv2D::initDelaunay(Rect rect)
  77. //
  78. /**
  79. * Creates a new empty Delaunay subdivision
  80. *
  81. * param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.
  82. */
  83. public void initDelaunay(Rect rect)
  84. {
  85. ThrowIfDisposed();
  86. imgproc_Subdiv2D_initDelaunay_10(nativeObj, rect.x, rect.y, rect.width, rect.height);
  87. }
  88. //
  89. // C++: int cv::Subdiv2D::insert(Point2f pt)
  90. //
  91. /**
  92. * Insert a single point into a Delaunay triangulation.
  93. *
  94. * param pt Point to insert.
  95. *
  96. * The function inserts a single point into a subdivision and modifies the subdivision topology
  97. * appropriately. If a point with the same coordinates exists already, no new point is added.
  98. * return the ID of the point.
  99. *
  100. * <b>Note:</b> If the point is outside of the triangulation specified rect a runtime error is raised.
  101. */
  102. public int insert(Point pt)
  103. {
  104. ThrowIfDisposed();
  105. return imgproc_Subdiv2D_insert_10(nativeObj, pt.x, pt.y);
  106. }
  107. //
  108. // C++: void cv::Subdiv2D::insert(vector_Point2f ptvec)
  109. //
  110. /**
  111. * Insert multiple points into a Delaunay triangulation.
  112. *
  113. * param ptvec Points to insert.
  114. *
  115. * The function inserts a vector of points into a subdivision and modifies the subdivision topology
  116. * appropriately.
  117. */
  118. public void insert(MatOfPoint2f ptvec)
  119. {
  120. ThrowIfDisposed();
  121. if (ptvec != null) ptvec.ThrowIfDisposed();
  122. Mat ptvec_mat = ptvec;
  123. imgproc_Subdiv2D_insert_11(nativeObj, ptvec_mat.nativeObj);
  124. }
  125. //
  126. // C++: int cv::Subdiv2D::locate(Point2f pt, int& edge, int& vertex)
  127. //
  128. /**
  129. * Returns the location of a point within a Delaunay triangulation.
  130. *
  131. * param pt Point to locate.
  132. * param edge Output edge that the point belongs to or is located to the right of it.
  133. * param vertex Optional output vertex the input point coincides with.
  134. *
  135. * The function locates the input point within the subdivision and gives one of the triangle edges
  136. * or vertices.
  137. *
  138. * return an integer which specify one of the following five cases for point location:
  139. * <ul>
  140. * <li>
  141. * The point falls into some facet. The function returns #PTLOC_INSIDE and edge will contain one of
  142. * edges of the facet.
  143. * </li>
  144. * <li>
  145. * The point falls onto the edge. The function returns #PTLOC_ON_EDGE and edge will contain this edge.
  146. * </li>
  147. * <li>
  148. * The point coincides with one of the subdivision vertices. The function returns #PTLOC_VERTEX and
  149. * vertex will contain a pointer to the vertex.
  150. * </li>
  151. * <li>
  152. * The point is outside the subdivision reference rectangle. The function returns #PTLOC_OUTSIDE_RECT
  153. * and no pointers are filled.
  154. * </li>
  155. * <li>
  156. * One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error
  157. * processing mode is selected, #PTLOC_ERROR is returned.
  158. * </li>
  159. * </ul>
  160. */
  161. public int locate(Point pt, int[] edge, int[] vertex)
  162. {
  163. ThrowIfDisposed();
  164. double[] edge_out = new double[1];
  165. double[] vertex_out = new double[1];
  166. int retVal = imgproc_Subdiv2D_locate_10(nativeObj, pt.x, pt.y, edge_out, vertex_out);
  167. if (edge != null) edge[0] = (int)edge_out[0];
  168. if (vertex != null) vertex[0] = (int)vertex_out[0];
  169. return retVal;
  170. }
  171. //
  172. // C++: int cv::Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt = 0)
  173. //
  174. /**
  175. * Finds the subdivision vertex closest to the given point.
  176. *
  177. * param pt Input point.
  178. * param nearestPt Output subdivision vertex point.
  179. *
  180. * The function is another function that locates the input point within the subdivision. It finds the
  181. * subdivision vertex that is the closest to the input point. It is not necessarily one of vertices
  182. * of the facet containing the input point, though the facet (located using locate() ) is used as a
  183. * starting point.
  184. *
  185. * return vertex ID.
  186. */
  187. public int findNearest(Point pt, Point nearestPt)
  188. {
  189. ThrowIfDisposed();
  190. double[] nearestPt_out = new double[2];
  191. int retVal = imgproc_Subdiv2D_findNearest_10(nativeObj, pt.x, pt.y, nearestPt_out);
  192. if (nearestPt != null) { nearestPt.x = nearestPt_out[0]; nearestPt.y = nearestPt_out[1]; }
  193. return retVal;
  194. }
  195. /**
  196. * Finds the subdivision vertex closest to the given point.
  197. *
  198. * param pt Input point.
  199. *
  200. * The function is another function that locates the input point within the subdivision. It finds the
  201. * subdivision vertex that is the closest to the input point. It is not necessarily one of vertices
  202. * of the facet containing the input point, though the facet (located using locate() ) is used as a
  203. * starting point.
  204. *
  205. * return vertex ID.
  206. */
  207. public int findNearest(Point pt)
  208. {
  209. ThrowIfDisposed();
  210. return imgproc_Subdiv2D_findNearest_11(nativeObj, pt.x, pt.y);
  211. }
  212. //
  213. // C++: void cv::Subdiv2D::getEdgeList(vector_Vec4f& edgeList)
  214. //
  215. /**
  216. * Returns a list of all edges.
  217. *
  218. * param edgeList Output vector.
  219. *
  220. * The function gives each edge as a 4 numbers vector, where each two are one of the edge
  221. * vertices. i.e. org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3].
  222. */
  223. public void getEdgeList(MatOfFloat4 edgeList)
  224. {
  225. ThrowIfDisposed();
  226. if (edgeList != null) edgeList.ThrowIfDisposed();
  227. Mat edgeList_mat = edgeList;
  228. imgproc_Subdiv2D_getEdgeList_10(nativeObj, edgeList_mat.nativeObj);
  229. }
  230. //
  231. // C++: void cv::Subdiv2D::getLeadingEdgeList(vector_int& leadingEdgeList)
  232. //
  233. /**
  234. * Returns a list of the leading edge ID connected to each triangle.
  235. *
  236. * param leadingEdgeList Output vector.
  237. *
  238. * The function gives one edge ID for each triangle.
  239. */
  240. public void getLeadingEdgeList(MatOfInt leadingEdgeList)
  241. {
  242. ThrowIfDisposed();
  243. if (leadingEdgeList != null) leadingEdgeList.ThrowIfDisposed();
  244. Mat leadingEdgeList_mat = leadingEdgeList;
  245. imgproc_Subdiv2D_getLeadingEdgeList_10(nativeObj, leadingEdgeList_mat.nativeObj);
  246. }
  247. //
  248. // C++: void cv::Subdiv2D::getTriangleList(vector_Vec6f& triangleList)
  249. //
  250. /**
  251. * Returns a list of all triangles.
  252. *
  253. * param triangleList Output vector.
  254. *
  255. * The function gives each triangle as a 6 numbers vector, where each two are one of the triangle
  256. * vertices. i.e. p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5].
  257. */
  258. public void getTriangleList(MatOfFloat6 triangleList)
  259. {
  260. ThrowIfDisposed();
  261. if (triangleList != null) triangleList.ThrowIfDisposed();
  262. Mat triangleList_mat = triangleList;
  263. imgproc_Subdiv2D_getTriangleList_10(nativeObj, triangleList_mat.nativeObj);
  264. }
  265. //
  266. // C++: void cv::Subdiv2D::getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters)
  267. //
  268. /**
  269. * Returns a list of all Voronoi facets.
  270. *
  271. * param idx Vector of vertices IDs to consider. For all vertices you can pass empty vector.
  272. * param facetList Output vector of the Voronoi facets.
  273. * param facetCenters Output vector of the Voronoi facets center points.
  274. */
  275. public void getVoronoiFacetList(MatOfInt idx, List<MatOfPoint2f> facetList, MatOfPoint2f facetCenters)
  276. {
  277. ThrowIfDisposed();
  278. if (idx != null) idx.ThrowIfDisposed();
  279. if (facetCenters != null) facetCenters.ThrowIfDisposed();
  280. Mat idx_mat = idx;
  281. Mat facetList_mat = new Mat();
  282. Mat facetCenters_mat = facetCenters;
  283. imgproc_Subdiv2D_getVoronoiFacetList_10(nativeObj, idx_mat.nativeObj, facetList_mat.nativeObj, facetCenters_mat.nativeObj);
  284. Converters.Mat_to_vector_vector_Point2f(facetList_mat, facetList);
  285. facetList_mat.release();
  286. }
  287. //
  288. // C++: Point2f cv::Subdiv2D::getVertex(int vertex, int* firstEdge = 0)
  289. //
  290. /**
  291. * Returns vertex location from vertex ID.
  292. *
  293. * param vertex vertex ID.
  294. * param firstEdge Optional. The first edge ID which is connected to the vertex.
  295. * return vertex (x,y)
  296. */
  297. public Point getVertex(int vertex, int[] firstEdge)
  298. {
  299. ThrowIfDisposed();
  300. double[] firstEdge_out = new double[1];
  301. double[] tmpArray = new double[2];
  302. imgproc_Subdiv2D_getVertex_10(nativeObj, vertex, firstEdge_out, tmpArray);
  303. Point retVal = new Point(tmpArray);
  304. if (firstEdge != null) firstEdge[0] = (int)firstEdge_out[0];
  305. return retVal;
  306. }
  307. /**
  308. * Returns vertex location from vertex ID.
  309. *
  310. * param vertex vertex ID.
  311. * return vertex (x,y)
  312. */
  313. public Point getVertex(int vertex)
  314. {
  315. ThrowIfDisposed();
  316. double[] tmpArray = new double[2];
  317. imgproc_Subdiv2D_getVertex_11(nativeObj, vertex, tmpArray);
  318. Point retVal = new Point(tmpArray);
  319. return retVal;
  320. }
  321. //
  322. // C++: int cv::Subdiv2D::getEdge(int edge, int nextEdgeType)
  323. //
  324. /**
  325. * Returns one of the edges related to the given edge.
  326. *
  327. * param edge Subdivision edge ID.
  328. * param nextEdgeType Parameter specifying which of the related edges to return.
  329. * The following values are possible:
  330. * <ul>
  331. * <li>
  332. * NEXT_AROUND_ORG next around the edge origin ( eOnext on the picture below if e is the input edge)
  333. * </li>
  334. * <li>
  335. * NEXT_AROUND_DST next around the edge vertex ( eDnext )
  336. * </li>
  337. * <li>
  338. * PREV_AROUND_ORG previous around the edge origin (reversed eRnext )
  339. * </li>
  340. * <li>
  341. * PREV_AROUND_DST previous around the edge destination (reversed eLnext )
  342. * </li>
  343. * <li>
  344. * NEXT_AROUND_LEFT next around the left facet ( eLnext )
  345. * </li>
  346. * <li>
  347. * NEXT_AROUND_RIGHT next around the right facet ( eRnext )
  348. * </li>
  349. * <li>
  350. * PREV_AROUND_LEFT previous around the left facet (reversed eOnext )
  351. * </li>
  352. * <li>
  353. * PREV_AROUND_RIGHT previous around the right facet (reversed eDnext )
  354. * </li>
  355. * </ul>
  356. *
  357. * ![sample output](pics/quadedge.png)
  358. *
  359. * return edge ID related to the input edge.
  360. */
  361. public int getEdge(int edge, int nextEdgeType)
  362. {
  363. ThrowIfDisposed();
  364. return imgproc_Subdiv2D_getEdge_10(nativeObj, edge, nextEdgeType);
  365. }
  366. //
  367. // C++: int cv::Subdiv2D::nextEdge(int edge)
  368. //
  369. /**
  370. * Returns next edge around the edge origin.
  371. *
  372. * param edge Subdivision edge ID.
  373. *
  374. * return an integer which is next edge ID around the edge origin: eOnext on the
  375. * picture above if e is the input edge).
  376. */
  377. public int nextEdge(int edge)
  378. {
  379. ThrowIfDisposed();
  380. return imgproc_Subdiv2D_nextEdge_10(nativeObj, edge);
  381. }
  382. //
  383. // C++: int cv::Subdiv2D::rotateEdge(int edge, int rotate)
  384. //
  385. /**
  386. * Returns another edge of the same quad-edge.
  387. *
  388. * param edge Subdivision edge ID.
  389. * param rotate Parameter specifying which of the edges of the same quad-edge as the input
  390. * one to return. The following values are possible:
  391. * <ul>
  392. * <li>
  393. * 0 - the input edge ( e on the picture below if e is the input edge)
  394. * </li>
  395. * <li>
  396. * 1 - the rotated edge ( eRot )
  397. * </li>
  398. * <li>
  399. * 2 - the reversed edge (reversed e (in green))
  400. * </li>
  401. * <li>
  402. * 3 - the reversed rotated edge (reversed eRot (in green))
  403. * </li>
  404. * </ul>
  405. *
  406. * return one of the edges ID of the same quad-edge as the input edge.
  407. */
  408. public int rotateEdge(int edge, int rotate)
  409. {
  410. ThrowIfDisposed();
  411. return imgproc_Subdiv2D_rotateEdge_10(nativeObj, edge, rotate);
  412. }
  413. //
  414. // C++: int cv::Subdiv2D::symEdge(int edge)
  415. //
  416. public int symEdge(int edge)
  417. {
  418. ThrowIfDisposed();
  419. return imgproc_Subdiv2D_symEdge_10(nativeObj, edge);
  420. }
  421. //
  422. // C++: int cv::Subdiv2D::edgeOrg(int edge, Point2f* orgpt = 0)
  423. //
  424. /**
  425. * Returns the edge origin.
  426. *
  427. * param edge Subdivision edge ID.
  428. * param orgpt Output vertex location.
  429. *
  430. * return vertex ID.
  431. */
  432. public int edgeOrg(int edge, Point orgpt)
  433. {
  434. ThrowIfDisposed();
  435. double[] orgpt_out = new double[2];
  436. int retVal = imgproc_Subdiv2D_edgeOrg_10(nativeObj, edge, orgpt_out);
  437. if (orgpt != null) { orgpt.x = orgpt_out[0]; orgpt.y = orgpt_out[1]; }
  438. return retVal;
  439. }
  440. /**
  441. * Returns the edge origin.
  442. *
  443. * param edge Subdivision edge ID.
  444. *
  445. * return vertex ID.
  446. */
  447. public int edgeOrg(int edge)
  448. {
  449. ThrowIfDisposed();
  450. return imgproc_Subdiv2D_edgeOrg_11(nativeObj, edge);
  451. }
  452. //
  453. // C++: int cv::Subdiv2D::edgeDst(int edge, Point2f* dstpt = 0)
  454. //
  455. /**
  456. * Returns the edge destination.
  457. *
  458. * param edge Subdivision edge ID.
  459. * param dstpt Output vertex location.
  460. *
  461. * return vertex ID.
  462. */
  463. public int edgeDst(int edge, Point dstpt)
  464. {
  465. ThrowIfDisposed();
  466. double[] dstpt_out = new double[2];
  467. int retVal = imgproc_Subdiv2D_edgeDst_10(nativeObj, edge, dstpt_out);
  468. if (dstpt != null) { dstpt.x = dstpt_out[0]; dstpt.y = dstpt_out[1]; }
  469. return retVal;
  470. }
  471. /**
  472. * Returns the edge destination.
  473. *
  474. * param edge Subdivision edge ID.
  475. *
  476. * return vertex ID.
  477. */
  478. public int edgeDst(int edge)
  479. {
  480. ThrowIfDisposed();
  481. return imgproc_Subdiv2D_edgeDst_11(nativeObj, edge);
  482. }
  483. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  484. const string LIBNAME = "__Internal";
  485. #else
  486. const string LIBNAME = "opencvforunity";
  487. #endif
  488. // C++: cv::Subdiv2D::Subdiv2D()
  489. [DllImport(LIBNAME)]
  490. private static extern IntPtr imgproc_Subdiv2D_Subdiv2D_10();
  491. // C++: cv::Subdiv2D::Subdiv2D(Rect rect)
  492. [DllImport(LIBNAME)]
  493. private static extern IntPtr imgproc_Subdiv2D_Subdiv2D_11(int rect_x, int rect_y, int rect_width, int rect_height);
  494. // C++: void cv::Subdiv2D::initDelaunay(Rect rect)
  495. [DllImport(LIBNAME)]
  496. private static extern void imgproc_Subdiv2D_initDelaunay_10(IntPtr nativeObj, int rect_x, int rect_y, int rect_width, int rect_height);
  497. // C++: int cv::Subdiv2D::insert(Point2f pt)
  498. [DllImport(LIBNAME)]
  499. private static extern int imgproc_Subdiv2D_insert_10(IntPtr nativeObj, double pt_x, double pt_y);
  500. // C++: void cv::Subdiv2D::insert(vector_Point2f ptvec)
  501. [DllImport(LIBNAME)]
  502. private static extern void imgproc_Subdiv2D_insert_11(IntPtr nativeObj, IntPtr ptvec_mat_nativeObj);
  503. // C++: int cv::Subdiv2D::locate(Point2f pt, int& edge, int& vertex)
  504. [DllImport(LIBNAME)]
  505. private static extern int imgproc_Subdiv2D_locate_10(IntPtr nativeObj, double pt_x, double pt_y, double[] edge_out, double[] vertex_out);
  506. // C++: int cv::Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt = 0)
  507. [DllImport(LIBNAME)]
  508. private static extern int imgproc_Subdiv2D_findNearest_10(IntPtr nativeObj, double pt_x, double pt_y, double[] nearestPt_out);
  509. [DllImport(LIBNAME)]
  510. private static extern int imgproc_Subdiv2D_findNearest_11(IntPtr nativeObj, double pt_x, double pt_y);
  511. // C++: void cv::Subdiv2D::getEdgeList(vector_Vec4f& edgeList)
  512. [DllImport(LIBNAME)]
  513. private static extern void imgproc_Subdiv2D_getEdgeList_10(IntPtr nativeObj, IntPtr edgeList_mat_nativeObj);
  514. // C++: void cv::Subdiv2D::getLeadingEdgeList(vector_int& leadingEdgeList)
  515. [DllImport(LIBNAME)]
  516. private static extern void imgproc_Subdiv2D_getLeadingEdgeList_10(IntPtr nativeObj, IntPtr leadingEdgeList_mat_nativeObj);
  517. // C++: void cv::Subdiv2D::getTriangleList(vector_Vec6f& triangleList)
  518. [DllImport(LIBNAME)]
  519. private static extern void imgproc_Subdiv2D_getTriangleList_10(IntPtr nativeObj, IntPtr triangleList_mat_nativeObj);
  520. // C++: void cv::Subdiv2D::getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters)
  521. [DllImport(LIBNAME)]
  522. private static extern void imgproc_Subdiv2D_getVoronoiFacetList_10(IntPtr nativeObj, IntPtr idx_mat_nativeObj, IntPtr facetList_mat_nativeObj, IntPtr facetCenters_mat_nativeObj);
  523. // C++: Point2f cv::Subdiv2D::getVertex(int vertex, int* firstEdge = 0)
  524. [DllImport(LIBNAME)]
  525. private static extern void imgproc_Subdiv2D_getVertex_10(IntPtr nativeObj, int vertex, double[] firstEdge_out, double[] retVal);
  526. [DllImport(LIBNAME)]
  527. private static extern void imgproc_Subdiv2D_getVertex_11(IntPtr nativeObj, int vertex, double[] retVal);
  528. // C++: int cv::Subdiv2D::getEdge(int edge, int nextEdgeType)
  529. [DllImport(LIBNAME)]
  530. private static extern int imgproc_Subdiv2D_getEdge_10(IntPtr nativeObj, int edge, int nextEdgeType);
  531. // C++: int cv::Subdiv2D::nextEdge(int edge)
  532. [DllImport(LIBNAME)]
  533. private static extern int imgproc_Subdiv2D_nextEdge_10(IntPtr nativeObj, int edge);
  534. // C++: int cv::Subdiv2D::rotateEdge(int edge, int rotate)
  535. [DllImport(LIBNAME)]
  536. private static extern int imgproc_Subdiv2D_rotateEdge_10(IntPtr nativeObj, int edge, int rotate);
  537. // C++: int cv::Subdiv2D::symEdge(int edge)
  538. [DllImport(LIBNAME)]
  539. private static extern int imgproc_Subdiv2D_symEdge_10(IntPtr nativeObj, int edge);
  540. // C++: int cv::Subdiv2D::edgeOrg(int edge, Point2f* orgpt = 0)
  541. [DllImport(LIBNAME)]
  542. private static extern int imgproc_Subdiv2D_edgeOrg_10(IntPtr nativeObj, int edge, double[] orgpt_out);
  543. [DllImport(LIBNAME)]
  544. private static extern int imgproc_Subdiv2D_edgeOrg_11(IntPtr nativeObj, int edge);
  545. // C++: int cv::Subdiv2D::edgeDst(int edge, Point2f* dstpt = 0)
  546. [DllImport(LIBNAME)]
  547. private static extern int imgproc_Subdiv2D_edgeDst_10(IntPtr nativeObj, int edge, double[] dstpt_out);
  548. [DllImport(LIBNAME)]
  549. private static extern int imgproc_Subdiv2D_edgeDst_11(IntPtr nativeObj, int edge);
  550. // native support for java finalize()
  551. [DllImport(LIBNAME)]
  552. private static extern void imgproc_Subdiv2D_delete(IntPtr nativeObj);
  553. }
  554. }