Objdetect.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.UtilsModule;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Runtime.InteropServices;
  6. namespace OpenCVForUnity.ObjdetectModule
  7. {
  8. // C++: class Objdetect
  9. public class Objdetect
  10. {
  11. // C++: enum <unnamed>
  12. public const int CASCADE_DO_CANNY_PRUNING = 1;
  13. public const int CASCADE_SCALE_IMAGE = 2;
  14. public const int CASCADE_FIND_BIGGEST_OBJECT = 4;
  15. public const int CASCADE_DO_ROUGH_SEARCH = 8;
  16. // C++: enum cv.DetectionBasedTracker.ObjectStatus
  17. public const int DetectionBasedTracker_DETECTED_NOT_SHOWN_YET = 0;
  18. public const int DetectionBasedTracker_DETECTED = 1;
  19. public const int DetectionBasedTracker_DETECTED_TEMPORARY_LOST = 2;
  20. public const int DetectionBasedTracker_WRONG_OBJECT = 3;
  21. // C++: enum cv.aruco.CornerRefineMethod
  22. public const int CORNER_REFINE_NONE = 0;
  23. public const int CORNER_REFINE_SUBPIX = 1;
  24. public const int CORNER_REFINE_CONTOUR = 2;
  25. public const int CORNER_REFINE_APRILTAG = 3;
  26. // C++: enum cv.aruco.PredefinedDictionaryType
  27. public const int DICT_4X4_50 = 0;
  28. public const int DICT_4X4_100 = 0 + 1;
  29. public const int DICT_4X4_250 = 0 + 2;
  30. public const int DICT_4X4_1000 = 0 + 3;
  31. public const int DICT_5X5_50 = 0 + 4;
  32. public const int DICT_5X5_100 = 0 + 5;
  33. public const int DICT_5X5_250 = 0 + 6;
  34. public const int DICT_5X5_1000 = 0 + 7;
  35. public const int DICT_6X6_50 = 0 + 8;
  36. public const int DICT_6X6_100 = 0 + 9;
  37. public const int DICT_6X6_250 = 0 + 10;
  38. public const int DICT_6X6_1000 = 0 + 11;
  39. public const int DICT_7X7_50 = 0 + 12;
  40. public const int DICT_7X7_100 = 0 + 13;
  41. public const int DICT_7X7_250 = 0 + 14;
  42. public const int DICT_7X7_1000 = 0 + 15;
  43. public const int DICT_ARUCO_ORIGINAL = 0 + 16;
  44. public const int DICT_APRILTAG_16h5 = 0 + 17;
  45. public const int DICT_APRILTAG_25h9 = 0 + 18;
  46. public const int DICT_APRILTAG_36h10 = 0 + 19;
  47. public const int DICT_APRILTAG_36h11 = 0 + 20;
  48. public const int DICT_ARUCO_MIP_36h12 = 0 + 21;
  49. //
  50. // C++: void cv::groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2)
  51. //
  52. public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold, double eps)
  53. {
  54. if (rectList != null) rectList.ThrowIfDisposed();
  55. if (weights != null) weights.ThrowIfDisposed();
  56. Mat rectList_mat = rectList;
  57. Mat weights_mat = weights;
  58. objdetect_Objdetect_groupRectangles_10(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold, eps);
  59. }
  60. public static void groupRectangles(MatOfRect rectList, MatOfInt weights, int groupThreshold)
  61. {
  62. if (rectList != null) rectList.ThrowIfDisposed();
  63. if (weights != null) weights.ThrowIfDisposed();
  64. Mat rectList_mat = rectList;
  65. Mat weights_mat = weights;
  66. objdetect_Objdetect_groupRectangles_11(rectList_mat.nativeObj, weights_mat.nativeObj, groupThreshold);
  67. }
  68. //
  69. // C++: void cv::aruco::drawDetectedMarkers(Mat& image, vector_Mat corners, Mat ids = Mat(), Scalar borderColor = Scalar(0, 255, 0))
  70. //
  71. /**
  72. * Draw detected markers in image
  73. *
  74. * param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  75. * param corners positions of marker corners on input image.
  76. * (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the dimensions of
  77. * this array should be Nx4. The order of the corners should be clockwise.
  78. * param ids vector of identifiers for markers in markersCorners .
  79. * Optional, if not provided, ids are not painted.
  80. * param borderColor color of marker borders. Rest of colors (text color and first corner color)
  81. * are calculated based on this one to improve visualization.
  82. *
  83. * Given an array of detected marker corners and its corresponding ids, this functions draws
  84. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  85. * Useful for debugging purposes.
  86. */
  87. public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids, Scalar borderColor)
  88. {
  89. if (image != null) image.ThrowIfDisposed();
  90. if (ids != null) ids.ThrowIfDisposed();
  91. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  92. objdetect_Objdetect_drawDetectedMarkers_10(image.nativeObj, corners_mat.nativeObj, ids.nativeObj, borderColor.val[0], borderColor.val[1], borderColor.val[2], borderColor.val[3]);
  93. }
  94. /**
  95. * Draw detected markers in image
  96. *
  97. * param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  98. * param corners positions of marker corners on input image.
  99. * (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the dimensions of
  100. * this array should be Nx4. The order of the corners should be clockwise.
  101. * param ids vector of identifiers for markers in markersCorners .
  102. * Optional, if not provided, ids are not painted.
  103. * are calculated based on this one to improve visualization.
  104. *
  105. * Given an array of detected marker corners and its corresponding ids, this functions draws
  106. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  107. * Useful for debugging purposes.
  108. */
  109. public static void drawDetectedMarkers(Mat image, List<Mat> corners, Mat ids)
  110. {
  111. if (image != null) image.ThrowIfDisposed();
  112. if (ids != null) ids.ThrowIfDisposed();
  113. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  114. objdetect_Objdetect_drawDetectedMarkers_11(image.nativeObj, corners_mat.nativeObj, ids.nativeObj);
  115. }
  116. /**
  117. * Draw detected markers in image
  118. *
  119. * param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  120. * param corners positions of marker corners on input image.
  121. * (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the dimensions of
  122. * this array should be Nx4. The order of the corners should be clockwise.
  123. * Optional, if not provided, ids are not painted.
  124. * are calculated based on this one to improve visualization.
  125. *
  126. * Given an array of detected marker corners and its corresponding ids, this functions draws
  127. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  128. * Useful for debugging purposes.
  129. */
  130. public static void drawDetectedMarkers(Mat image, List<Mat> corners)
  131. {
  132. if (image != null) image.ThrowIfDisposed();
  133. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  134. objdetect_Objdetect_drawDetectedMarkers_12(image.nativeObj, corners_mat.nativeObj);
  135. }
  136. //
  137. // C++: void cv::aruco::generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat& img, int borderBits = 1)
  138. //
  139. /**
  140. * Generate a canonical marker image
  141. *
  142. * param dictionary dictionary of markers indicating the type of markers
  143. * param id identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
  144. * param sidePixels size of the image in pixels
  145. * param img output image with the marker
  146. * param borderBits width of the marker border.
  147. *
  148. * This function returns a marker image in its canonical form (i.e. ready to be printed)
  149. */
  150. public static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img, int borderBits)
  151. {
  152. if (dictionary != null) dictionary.ThrowIfDisposed();
  153. if (img != null) img.ThrowIfDisposed();
  154. objdetect_Objdetect_generateImageMarker_10(dictionary.nativeObj, id, sidePixels, img.nativeObj, borderBits);
  155. }
  156. /**
  157. * Generate a canonical marker image
  158. *
  159. * param dictionary dictionary of markers indicating the type of markers
  160. * param id identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
  161. * param sidePixels size of the image in pixels
  162. * param img output image with the marker
  163. *
  164. * This function returns a marker image in its canonical form (i.e. ready to be printed)
  165. */
  166. public static void generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat img)
  167. {
  168. if (dictionary != null) dictionary.ThrowIfDisposed();
  169. if (img != null) img.ThrowIfDisposed();
  170. objdetect_Objdetect_generateImageMarker_11(dictionary.nativeObj, id, sidePixels, img.nativeObj);
  171. }
  172. //
  173. // C++: Dictionary cv::aruco::getPredefinedDictionary(int dict)
  174. //
  175. /**
  176. * Returns one of the predefined dictionaries referenced by DICT_*.
  177. * param dict automatically generated
  178. * return automatically generated
  179. */
  180. public static Dictionary getPredefinedDictionary(int dict)
  181. {
  182. return new Dictionary(DisposableObject.ThrowIfNullIntPtr(objdetect_Objdetect_getPredefinedDictionary_10(dict)));
  183. }
  184. //
  185. // C++: Dictionary cv::aruco::extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary = Dictionary(), int randomSeed = 0)
  186. //
  187. /**
  188. * Extend base dictionary by new nMarkers
  189. *
  190. * param nMarkers number of markers in the dictionary
  191. * param markerSize number of bits per dimension of each markers
  192. * param baseDictionary Include the markers in this dictionary at the beginning (optional)
  193. * param randomSeed a user supplied seed for theRNG()
  194. *
  195. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  196. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  197. * included and the rest are generated based on them. If the size of baseDictionary is higher
  198. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  199. * return automatically generated
  200. */
  201. public static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary, int randomSeed)
  202. {
  203. if (baseDictionary != null) baseDictionary.ThrowIfDisposed();
  204. return new Dictionary(DisposableObject.ThrowIfNullIntPtr(objdetect_Objdetect_extendDictionary_10(nMarkers, markerSize, baseDictionary.nativeObj, randomSeed)));
  205. }
  206. /**
  207. * Extend base dictionary by new nMarkers
  208. *
  209. * param nMarkers number of markers in the dictionary
  210. * param markerSize number of bits per dimension of each markers
  211. * param baseDictionary Include the markers in this dictionary at the beginning (optional)
  212. *
  213. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  214. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  215. * included and the rest are generated based on them. If the size of baseDictionary is higher
  216. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  217. * return automatically generated
  218. */
  219. public static Dictionary extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary)
  220. {
  221. if (baseDictionary != null) baseDictionary.ThrowIfDisposed();
  222. return new Dictionary(DisposableObject.ThrowIfNullIntPtr(objdetect_Objdetect_extendDictionary_11(nMarkers, markerSize, baseDictionary.nativeObj)));
  223. }
  224. /**
  225. * Extend base dictionary by new nMarkers
  226. *
  227. * param nMarkers number of markers in the dictionary
  228. * param markerSize number of bits per dimension of each markers
  229. *
  230. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  231. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  232. * included and the rest are generated based on them. If the size of baseDictionary is higher
  233. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  234. * return automatically generated
  235. */
  236. public static Dictionary extendDictionary(int nMarkers, int markerSize)
  237. {
  238. return new Dictionary(DisposableObject.ThrowIfNullIntPtr(objdetect_Objdetect_extendDictionary_12(nMarkers, markerSize)));
  239. }
  240. //
  241. // C++: void cv::aruco::drawDetectedCornersCharuco(Mat& image, Mat charucoCorners, Mat charucoIds = Mat(), Scalar cornerColor = Scalar(255, 0, 0))
  242. //
  243. /**
  244. * Draws a set of Charuco corners
  245. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  246. * altered.
  247. * param charucoCorners vector of detected charuco corners
  248. * param charucoIds list of identifiers for each corner in charucoCorners
  249. * param cornerColor color of the square surrounding each corner
  250. *
  251. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  252. * draws the id of each corner.
  253. */
  254. public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds, Scalar cornerColor)
  255. {
  256. if (image != null) image.ThrowIfDisposed();
  257. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  258. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  259. objdetect_Objdetect_drawDetectedCornersCharuco_10(image.nativeObj, charucoCorners.nativeObj, charucoIds.nativeObj, cornerColor.val[0], cornerColor.val[1], cornerColor.val[2], cornerColor.val[3]);
  260. }
  261. /**
  262. * Draws a set of Charuco corners
  263. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  264. * altered.
  265. * param charucoCorners vector of detected charuco corners
  266. * param charucoIds list of identifiers for each corner in charucoCorners
  267. *
  268. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  269. * draws the id of each corner.
  270. */
  271. public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners, Mat charucoIds)
  272. {
  273. if (image != null) image.ThrowIfDisposed();
  274. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  275. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  276. objdetect_Objdetect_drawDetectedCornersCharuco_11(image.nativeObj, charucoCorners.nativeObj, charucoIds.nativeObj);
  277. }
  278. /**
  279. * Draws a set of Charuco corners
  280. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  281. * altered.
  282. * param charucoCorners vector of detected charuco corners
  283. *
  284. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  285. * draws the id of each corner.
  286. */
  287. public static void drawDetectedCornersCharuco(Mat image, Mat charucoCorners)
  288. {
  289. if (image != null) image.ThrowIfDisposed();
  290. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  291. objdetect_Objdetect_drawDetectedCornersCharuco_12(image.nativeObj, charucoCorners.nativeObj);
  292. }
  293. //
  294. // C++: void cv::aruco::drawDetectedDiamonds(Mat& image, vector_Mat diamondCorners, Mat diamondIds = Mat(), Scalar borderColor = Scalar(0, 0, 255))
  295. //
  296. /**
  297. * Draw a set of detected ChArUco Diamond markers
  298. *
  299. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  300. * altered.
  301. * param diamondCorners positions of diamond corners in the same format returned by
  302. * detectCharucoDiamond(). (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers,
  303. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  304. * param diamondIds vector of identifiers for diamonds in diamondCorners, in the same format
  305. * returned by detectCharucoDiamond() (e.g. std::vector&lt;Vec4i&gt;).
  306. * Optional, if not provided, ids are not painted.
  307. * param borderColor color of marker borders. Rest of colors (text color and first corner color)
  308. * are calculated based on this one.
  309. *
  310. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  311. * are painted and the markers identifiers if provided.
  312. * Useful for debugging purposes.
  313. */
  314. public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds, Scalar borderColor)
  315. {
  316. if (image != null) image.ThrowIfDisposed();
  317. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  318. Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
  319. objdetect_Objdetect_drawDetectedDiamonds_10(image.nativeObj, diamondCorners_mat.nativeObj, diamondIds.nativeObj, borderColor.val[0], borderColor.val[1], borderColor.val[2], borderColor.val[3]);
  320. }
  321. /**
  322. * Draw a set of detected ChArUco Diamond markers
  323. *
  324. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  325. * altered.
  326. * param diamondCorners positions of diamond corners in the same format returned by
  327. * detectCharucoDiamond(). (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers,
  328. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  329. * param diamondIds vector of identifiers for diamonds in diamondCorners, in the same format
  330. * returned by detectCharucoDiamond() (e.g. std::vector&lt;Vec4i&gt;).
  331. * Optional, if not provided, ids are not painted.
  332. * are calculated based on this one.
  333. *
  334. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  335. * are painted and the markers identifiers if provided.
  336. * Useful for debugging purposes.
  337. */
  338. public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners, Mat diamondIds)
  339. {
  340. if (image != null) image.ThrowIfDisposed();
  341. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  342. Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
  343. objdetect_Objdetect_drawDetectedDiamonds_11(image.nativeObj, diamondCorners_mat.nativeObj, diamondIds.nativeObj);
  344. }
  345. /**
  346. * Draw a set of detected ChArUco Diamond markers
  347. *
  348. * param image input/output image. It must have 1 or 3 channels. The number of channels is not
  349. * altered.
  350. * param diamondCorners positions of diamond corners in the same format returned by
  351. * detectCharucoDiamond(). (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers,
  352. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  353. * returned by detectCharucoDiamond() (e.g. std::vector&lt;Vec4i&gt;).
  354. * Optional, if not provided, ids are not painted.
  355. * are calculated based on this one.
  356. *
  357. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  358. * are painted and the markers identifiers if provided.
  359. * Useful for debugging purposes.
  360. */
  361. public static void drawDetectedDiamonds(Mat image, List<Mat> diamondCorners)
  362. {
  363. if (image != null) image.ThrowIfDisposed();
  364. Mat diamondCorners_mat = Converters.vector_Mat_to_Mat(diamondCorners);
  365. objdetect_Objdetect_drawDetectedDiamonds_12(image.nativeObj, diamondCorners_mat.nativeObj);
  366. }
  367. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  368. const string LIBNAME = "__Internal";
  369. #else
  370. const string LIBNAME = "opencvforunity";
  371. #endif
  372. // C++: void cv::groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2)
  373. [DllImport(LIBNAME)]
  374. private static extern void objdetect_Objdetect_groupRectangles_10(IntPtr rectList_mat_nativeObj, IntPtr weights_mat_nativeObj, int groupThreshold, double eps);
  375. [DllImport(LIBNAME)]
  376. private static extern void objdetect_Objdetect_groupRectangles_11(IntPtr rectList_mat_nativeObj, IntPtr weights_mat_nativeObj, int groupThreshold);
  377. // C++: void cv::aruco::drawDetectedMarkers(Mat& image, vector_Mat corners, Mat ids = Mat(), Scalar borderColor = Scalar(0, 255, 0))
  378. [DllImport(LIBNAME)]
  379. private static extern void objdetect_Objdetect_drawDetectedMarkers_10(IntPtr image_nativeObj, IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, double borderColor_val0, double borderColor_val1, double borderColor_val2, double borderColor_val3);
  380. [DllImport(LIBNAME)]
  381. private static extern void objdetect_Objdetect_drawDetectedMarkers_11(IntPtr image_nativeObj, IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj);
  382. [DllImport(LIBNAME)]
  383. private static extern void objdetect_Objdetect_drawDetectedMarkers_12(IntPtr image_nativeObj, IntPtr corners_mat_nativeObj);
  384. // C++: void cv::aruco::generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat& img, int borderBits = 1)
  385. [DllImport(LIBNAME)]
  386. private static extern void objdetect_Objdetect_generateImageMarker_10(IntPtr dictionary_nativeObj, int id, int sidePixels, IntPtr img_nativeObj, int borderBits);
  387. [DllImport(LIBNAME)]
  388. private static extern void objdetect_Objdetect_generateImageMarker_11(IntPtr dictionary_nativeObj, int id, int sidePixels, IntPtr img_nativeObj);
  389. // C++: Dictionary cv::aruco::getPredefinedDictionary(int dict)
  390. [DllImport(LIBNAME)]
  391. private static extern IntPtr objdetect_Objdetect_getPredefinedDictionary_10(int dict);
  392. // C++: Dictionary cv::aruco::extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary = Dictionary(), int randomSeed = 0)
  393. [DllImport(LIBNAME)]
  394. private static extern IntPtr objdetect_Objdetect_extendDictionary_10(int nMarkers, int markerSize, IntPtr baseDictionary_nativeObj, int randomSeed);
  395. [DllImport(LIBNAME)]
  396. private static extern IntPtr objdetect_Objdetect_extendDictionary_11(int nMarkers, int markerSize, IntPtr baseDictionary_nativeObj);
  397. [DllImport(LIBNAME)]
  398. private static extern IntPtr objdetect_Objdetect_extendDictionary_12(int nMarkers, int markerSize);
  399. // C++: void cv::aruco::drawDetectedCornersCharuco(Mat& image, Mat charucoCorners, Mat charucoIds = Mat(), Scalar cornerColor = Scalar(255, 0, 0))
  400. [DllImport(LIBNAME)]
  401. private static extern void objdetect_Objdetect_drawDetectedCornersCharuco_10(IntPtr image_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, double cornerColor_val0, double cornerColor_val1, double cornerColor_val2, double cornerColor_val3);
  402. [DllImport(LIBNAME)]
  403. private static extern void objdetect_Objdetect_drawDetectedCornersCharuco_11(IntPtr image_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj);
  404. [DllImport(LIBNAME)]
  405. private static extern void objdetect_Objdetect_drawDetectedCornersCharuco_12(IntPtr image_nativeObj, IntPtr charucoCorners_nativeObj);
  406. // C++: void cv::aruco::drawDetectedDiamonds(Mat& image, vector_Mat diamondCorners, Mat diamondIds = Mat(), Scalar borderColor = Scalar(0, 0, 255))
  407. [DllImport(LIBNAME)]
  408. private static extern void objdetect_Objdetect_drawDetectedDiamonds_10(IntPtr image_nativeObj, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj, double borderColor_val0, double borderColor_val1, double borderColor_val2, double borderColor_val3);
  409. [DllImport(LIBNAME)]
  410. private static extern void objdetect_Objdetect_drawDetectedDiamonds_11(IntPtr image_nativeObj, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj);
  411. [DllImport(LIBNAME)]
  412. private static extern void objdetect_Objdetect_drawDetectedDiamonds_12(IntPtr image_nativeObj, IntPtr diamondCorners_mat_nativeObj);
  413. }
  414. }