Aruco.cs 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736
  1. using OpenCVForUnity.CoreModule;
  2. using OpenCVForUnity.ObjdetectModule;
  3. using OpenCVForUnity.UtilsModule;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. namespace OpenCVForUnity.ArucoModule
  8. {
  9. // C++: class Aruco
  10. public class Aruco
  11. {
  12. // C++: enum cv.aruco.PatternPositionType
  13. public const int ARUCO_CCW_CENTER = 0;
  14. public const int ARUCO_CW_TOP_LEFT_CORNER = 1;
  15. //
  16. // C++: void cv::aruco::detectMarkers(Mat image, Ptr_Dictionary dictionary, vector_Mat& corners, Mat& ids, Ptr_DetectorParameters parameters = makePtr<DetectorParameters>(), vector_Mat& rejectedImgPoints = vector_Mat())
  17. //
  18. /**
  19. * detect markers
  20. * deprecated Use class ArucoDetector::detectMarkers
  21. * param image automatically generated
  22. * param dictionary automatically generated
  23. * param corners automatically generated
  24. * param ids automatically generated
  25. * param parameters automatically generated
  26. * param rejectedImgPoints automatically generated
  27. */
  28. [Obsolete("This method is deprecated.")]
  29. public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters, List<Mat> rejectedImgPoints)
  30. {
  31. if (image != null) image.ThrowIfDisposed();
  32. if (dictionary != null) dictionary.ThrowIfDisposed();
  33. if (ids != null) ids.ThrowIfDisposed();
  34. if (parameters != null) parameters.ThrowIfDisposed();
  35. Mat corners_mat = new Mat();
  36. Mat rejectedImgPoints_mat = new Mat();
  37. aruco_Aruco_detectMarkers_10(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr(), rejectedImgPoints_mat.nativeObj);
  38. Converters.Mat_to_vector_Mat(corners_mat, corners);
  39. corners_mat.release();
  40. Converters.Mat_to_vector_Mat(rejectedImgPoints_mat, rejectedImgPoints);
  41. rejectedImgPoints_mat.release();
  42. }
  43. /**
  44. * detect markers
  45. * deprecated Use class ArucoDetector::detectMarkers
  46. * param image automatically generated
  47. * param dictionary automatically generated
  48. * param corners automatically generated
  49. * param ids automatically generated
  50. * param parameters automatically generated
  51. */
  52. [Obsolete("This method is deprecated.")]
  53. public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids, DetectorParameters parameters)
  54. {
  55. if (image != null) image.ThrowIfDisposed();
  56. if (dictionary != null) dictionary.ThrowIfDisposed();
  57. if (ids != null) ids.ThrowIfDisposed();
  58. if (parameters != null) parameters.ThrowIfDisposed();
  59. Mat corners_mat = new Mat();
  60. aruco_Aruco_detectMarkers_11(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj, parameters.getNativeObjAddr());
  61. Converters.Mat_to_vector_Mat(corners_mat, corners);
  62. corners_mat.release();
  63. }
  64. /**
  65. * detect markers
  66. * deprecated Use class ArucoDetector::detectMarkers
  67. * param image automatically generated
  68. * param dictionary automatically generated
  69. * param corners automatically generated
  70. * param ids automatically generated
  71. */
  72. [Obsolete("This method is deprecated.")]
  73. public static void detectMarkers(Mat image, Dictionary dictionary, List<Mat> corners, Mat ids)
  74. {
  75. if (image != null) image.ThrowIfDisposed();
  76. if (dictionary != null) dictionary.ThrowIfDisposed();
  77. if (ids != null) ids.ThrowIfDisposed();
  78. Mat corners_mat = new Mat();
  79. aruco_Aruco_detectMarkers_12(image.nativeObj, dictionary.getNativeObjAddr(), corners_mat.nativeObj, ids.nativeObj);
  80. Converters.Mat_to_vector_Mat(corners_mat, corners);
  81. corners_mat.release();
  82. }
  83. //
  84. // C++: void cv::aruco::refineDetectedMarkers(Mat image, Ptr_Board board, vector_Mat& detectedCorners, Mat& detectedIds, vector_Mat& rejectedCorners, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true, Mat& recoveredIdxs = Mat(), Ptr_DetectorParameters parameters = makePtr<DetectorParameters>())
  85. //
  86. /**
  87. * refine detected markers
  88. * deprecated Use class ArucoDetector::refineDetectedMarkers
  89. * param image automatically generated
  90. * param board automatically generated
  91. * param detectedCorners automatically generated
  92. * param detectedIds automatically generated
  93. * param rejectedCorners automatically generated
  94. * param cameraMatrix automatically generated
  95. * param distCoeffs automatically generated
  96. * param minRepDistance automatically generated
  97. * param errorCorrectionRate automatically generated
  98. * param checkAllOrders automatically generated
  99. * param recoveredIdxs automatically generated
  100. * param parameters automatically generated
  101. */
  102. [Obsolete("This method is deprecated.")]
  103. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, bool checkAllOrders, Mat recoveredIdxs, DetectorParameters parameters)
  104. {
  105. if (image != null) image.ThrowIfDisposed();
  106. if (board != null) board.ThrowIfDisposed();
  107. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  108. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  109. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  110. if (recoveredIdxs != null) recoveredIdxs.ThrowIfDisposed();
  111. if (parameters != null) parameters.ThrowIfDisposed();
  112. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  113. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  114. aruco_Aruco_refineDetectedMarkers_10(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs.nativeObj, parameters.getNativeObjAddr());
  115. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  116. detectedCorners_mat.release();
  117. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  118. rejectedCorners_mat.release();
  119. }
  120. /**
  121. * refine detected markers
  122. * deprecated Use class ArucoDetector::refineDetectedMarkers
  123. * param image automatically generated
  124. * param board automatically generated
  125. * param detectedCorners automatically generated
  126. * param detectedIds automatically generated
  127. * param rejectedCorners automatically generated
  128. * param cameraMatrix automatically generated
  129. * param distCoeffs automatically generated
  130. * param minRepDistance automatically generated
  131. * param errorCorrectionRate automatically generated
  132. * param checkAllOrders automatically generated
  133. * param recoveredIdxs automatically generated
  134. */
  135. [Obsolete("This method is deprecated.")]
  136. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, bool checkAllOrders, Mat recoveredIdxs)
  137. {
  138. if (image != null) image.ThrowIfDisposed();
  139. if (board != null) board.ThrowIfDisposed();
  140. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  141. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  142. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  143. if (recoveredIdxs != null) recoveredIdxs.ThrowIfDisposed();
  144. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  145. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  146. aruco_Aruco_refineDetectedMarkers_11(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs.nativeObj);
  147. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  148. detectedCorners_mat.release();
  149. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  150. rejectedCorners_mat.release();
  151. }
  152. /**
  153. * refine detected markers
  154. * deprecated Use class ArucoDetector::refineDetectedMarkers
  155. * param image automatically generated
  156. * param board automatically generated
  157. * param detectedCorners automatically generated
  158. * param detectedIds automatically generated
  159. * param rejectedCorners automatically generated
  160. * param cameraMatrix automatically generated
  161. * param distCoeffs automatically generated
  162. * param minRepDistance automatically generated
  163. * param errorCorrectionRate automatically generated
  164. * param checkAllOrders automatically generated
  165. */
  166. [Obsolete("This method is deprecated.")]
  167. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate, bool checkAllOrders)
  168. {
  169. if (image != null) image.ThrowIfDisposed();
  170. if (board != null) board.ThrowIfDisposed();
  171. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  172. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  173. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  174. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  175. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  176. aruco_Aruco_refineDetectedMarkers_12(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate, checkAllOrders);
  177. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  178. detectedCorners_mat.release();
  179. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  180. rejectedCorners_mat.release();
  181. }
  182. /**
  183. * refine detected markers
  184. * deprecated Use class ArucoDetector::refineDetectedMarkers
  185. * param image automatically generated
  186. * param board automatically generated
  187. * param detectedCorners automatically generated
  188. * param detectedIds automatically generated
  189. * param rejectedCorners automatically generated
  190. * param cameraMatrix automatically generated
  191. * param distCoeffs automatically generated
  192. * param minRepDistance automatically generated
  193. * param errorCorrectionRate automatically generated
  194. */
  195. [Obsolete("This method is deprecated.")]
  196. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance, float errorCorrectionRate)
  197. {
  198. if (image != null) image.ThrowIfDisposed();
  199. if (board != null) board.ThrowIfDisposed();
  200. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  201. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  202. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  203. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  204. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  205. aruco_Aruco_refineDetectedMarkers_13(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance, errorCorrectionRate);
  206. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  207. detectedCorners_mat.release();
  208. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  209. rejectedCorners_mat.release();
  210. }
  211. /**
  212. * refine detected markers
  213. * deprecated Use class ArucoDetector::refineDetectedMarkers
  214. * param image automatically generated
  215. * param board automatically generated
  216. * param detectedCorners automatically generated
  217. * param detectedIds automatically generated
  218. * param rejectedCorners automatically generated
  219. * param cameraMatrix automatically generated
  220. * param distCoeffs automatically generated
  221. * param minRepDistance automatically generated
  222. */
  223. [Obsolete("This method is deprecated.")]
  224. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs, float minRepDistance)
  225. {
  226. if (image != null) image.ThrowIfDisposed();
  227. if (board != null) board.ThrowIfDisposed();
  228. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  229. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  230. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  231. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  232. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  233. aruco_Aruco_refineDetectedMarkers_14(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minRepDistance);
  234. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  235. detectedCorners_mat.release();
  236. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  237. rejectedCorners_mat.release();
  238. }
  239. /**
  240. * refine detected markers
  241. * deprecated Use class ArucoDetector::refineDetectedMarkers
  242. * param image automatically generated
  243. * param board automatically generated
  244. * param detectedCorners automatically generated
  245. * param detectedIds automatically generated
  246. * param rejectedCorners automatically generated
  247. * param cameraMatrix automatically generated
  248. * param distCoeffs automatically generated
  249. */
  250. [Obsolete("This method is deprecated.")]
  251. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix, Mat distCoeffs)
  252. {
  253. if (image != null) image.ThrowIfDisposed();
  254. if (board != null) board.ThrowIfDisposed();
  255. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  256. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  257. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  258. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  259. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  260. aruco_Aruco_refineDetectedMarkers_15(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
  261. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  262. detectedCorners_mat.release();
  263. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  264. rejectedCorners_mat.release();
  265. }
  266. /**
  267. * refine detected markers
  268. * deprecated Use class ArucoDetector::refineDetectedMarkers
  269. * param image automatically generated
  270. * param board automatically generated
  271. * param detectedCorners automatically generated
  272. * param detectedIds automatically generated
  273. * param rejectedCorners automatically generated
  274. * param cameraMatrix automatically generated
  275. */
  276. [Obsolete("This method is deprecated.")]
  277. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners, Mat cameraMatrix)
  278. {
  279. if (image != null) image.ThrowIfDisposed();
  280. if (board != null) board.ThrowIfDisposed();
  281. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  282. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  283. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  284. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  285. aruco_Aruco_refineDetectedMarkers_16(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj, cameraMatrix.nativeObj);
  286. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  287. detectedCorners_mat.release();
  288. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  289. rejectedCorners_mat.release();
  290. }
  291. /**
  292. * refine detected markers
  293. * deprecated Use class ArucoDetector::refineDetectedMarkers
  294. * param image automatically generated
  295. * param board automatically generated
  296. * param detectedCorners automatically generated
  297. * param detectedIds automatically generated
  298. * param rejectedCorners automatically generated
  299. */
  300. [Obsolete("This method is deprecated.")]
  301. public static void refineDetectedMarkers(Mat image, Board board, List<Mat> detectedCorners, Mat detectedIds, List<Mat> rejectedCorners)
  302. {
  303. if (image != null) image.ThrowIfDisposed();
  304. if (board != null) board.ThrowIfDisposed();
  305. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  306. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  307. Mat rejectedCorners_mat = Converters.vector_Mat_to_Mat(rejectedCorners);
  308. aruco_Aruco_refineDetectedMarkers_17(image.nativeObj, board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, rejectedCorners_mat.nativeObj);
  309. Converters.Mat_to_vector_Mat(detectedCorners_mat, detectedCorners);
  310. detectedCorners_mat.release();
  311. Converters.Mat_to_vector_Mat(rejectedCorners_mat, rejectedCorners);
  312. rejectedCorners_mat.release();
  313. }
  314. //
  315. // C++: void cv::aruco::drawPlanarBoard(Ptr_Board board, Size outSize, Mat& img, int marginSize, int borderBits)
  316. //
  317. /**
  318. * draw planar board
  319. * deprecated Use Board::generateImage
  320. * param board automatically generated
  321. * param outSize automatically generated
  322. * param img automatically generated
  323. * param marginSize automatically generated
  324. * param borderBits automatically generated
  325. */
  326. [Obsolete("This method is deprecated.")]
  327. public static void drawPlanarBoard(Board board, Size outSize, Mat img, int marginSize, int borderBits)
  328. {
  329. if (board != null) board.ThrowIfDisposed();
  330. if (img != null) img.ThrowIfDisposed();
  331. aruco_Aruco_drawPlanarBoard_10(board.getNativeObjAddr(), outSize.width, outSize.height, img.nativeObj, marginSize, borderBits);
  332. }
  333. //
  334. // C++: void cv::aruco::getBoardObjectAndImagePoints(Ptr_Board board, vector_Mat detectedCorners, Mat detectedIds, Mat& objPoints, Mat& imgPoints)
  335. //
  336. /**
  337. * get board object and image points
  338. * deprecated Use Board::matchImagePoints
  339. * param board automatically generated
  340. * param detectedCorners automatically generated
  341. * param detectedIds automatically generated
  342. * param objPoints automatically generated
  343. * param imgPoints automatically generated
  344. */
  345. [Obsolete("This method is deprecated.")]
  346. public static void getBoardObjectAndImagePoints(Board board, List<Mat> detectedCorners, Mat detectedIds, Mat objPoints, Mat imgPoints)
  347. {
  348. if (board != null) board.ThrowIfDisposed();
  349. if (detectedIds != null) detectedIds.ThrowIfDisposed();
  350. if (objPoints != null) objPoints.ThrowIfDisposed();
  351. if (imgPoints != null) imgPoints.ThrowIfDisposed();
  352. Mat detectedCorners_mat = Converters.vector_Mat_to_Mat(detectedCorners);
  353. aruco_Aruco_getBoardObjectAndImagePoints_10(board.getNativeObjAddr(), detectedCorners_mat.nativeObj, detectedIds.nativeObj, objPoints.nativeObj, imgPoints.nativeObj);
  354. }
  355. //
  356. // C++: int cv::aruco::estimatePoseBoard(vector_Mat corners, Mat ids, Ptr_Board board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
  357. //
  358. /**
  359. * deprecated Use cv::solvePnP
  360. * param corners automatically generated
  361. * param ids automatically generated
  362. * param board automatically generated
  363. * param cameraMatrix automatically generated
  364. * param distCoeffs automatically generated
  365. * param rvec automatically generated
  366. * param tvec automatically generated
  367. * param useExtrinsicGuess automatically generated
  368. * return automatically generated
  369. */
  370. [Obsolete("This method is deprecated.")]
  371. public static int estimatePoseBoard(List<Mat> corners, Mat ids, Board board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, bool useExtrinsicGuess)
  372. {
  373. if (ids != null) ids.ThrowIfDisposed();
  374. if (board != null) board.ThrowIfDisposed();
  375. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  376. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  377. if (rvec != null) rvec.ThrowIfDisposed();
  378. if (tvec != null) tvec.ThrowIfDisposed();
  379. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  380. return aruco_Aruco_estimatePoseBoard_10(corners_mat.nativeObj, ids.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess);
  381. }
  382. /**
  383. * deprecated Use cv::solvePnP
  384. * param corners automatically generated
  385. * param ids automatically generated
  386. * param board automatically generated
  387. * param cameraMatrix automatically generated
  388. * param distCoeffs automatically generated
  389. * param rvec automatically generated
  390. * param tvec automatically generated
  391. * return automatically generated
  392. */
  393. [Obsolete("This method is deprecated.")]
  394. public static int estimatePoseBoard(List<Mat> corners, Mat ids, Board board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
  395. {
  396. if (ids != null) ids.ThrowIfDisposed();
  397. if (board != null) board.ThrowIfDisposed();
  398. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  399. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  400. if (rvec != null) rvec.ThrowIfDisposed();
  401. if (tvec != null) tvec.ThrowIfDisposed();
  402. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  403. return aruco_Aruco_estimatePoseBoard_11(corners_mat.nativeObj, ids.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj);
  404. }
  405. //
  406. // C++: bool cv::aruco::estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, Ptr_CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
  407. //
  408. /**
  409. * Pose estimation for a ChArUco board given some of their corners
  410. * param charucoCorners vector of detected charuco corners
  411. * param charucoIds list of identifiers for each corner in charucoCorners
  412. * param board layout of ChArUco board.
  413. * param cameraMatrix input 3x3 floating-point camera matrix
  414. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  415. * param distCoeffs vector of distortion coefficients
  416. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  417. * param rvec Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board
  418. * (see cv::Rodrigues).
  419. * param tvec Output vector (e.g. cv::Mat) corresponding to the translation vector of the board.
  420. * param useExtrinsicGuess defines whether initial guess for \b rvec and \b tvec will be used or not.
  421. *
  422. * This function estimates a Charuco board pose from some detected corners.
  423. * The function checks if the input corners are enough and valid to perform pose estimation.
  424. * If pose estimation is valid, returns true, else returns false.
  425. * SEE: use cv::drawFrameAxes to get world coordinate system axis for object points
  426. * return automatically generated
  427. */
  428. public static bool estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec, bool useExtrinsicGuess)
  429. {
  430. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  431. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  432. if (board != null) board.ThrowIfDisposed();
  433. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  434. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  435. if (rvec != null) rvec.ThrowIfDisposed();
  436. if (tvec != null) tvec.ThrowIfDisposed();
  437. return aruco_Aruco_estimatePoseCharucoBoard_10(charucoCorners.nativeObj, charucoIds.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj, useExtrinsicGuess);
  438. }
  439. /**
  440. * Pose estimation for a ChArUco board given some of their corners
  441. * param charucoCorners vector of detected charuco corners
  442. * param charucoIds list of identifiers for each corner in charucoCorners
  443. * param board layout of ChArUco board.
  444. * param cameraMatrix input 3x3 floating-point camera matrix
  445. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  446. * param distCoeffs vector of distortion coefficients
  447. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  448. * param rvec Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board
  449. * (see cv::Rodrigues).
  450. * param tvec Output vector (e.g. cv::Mat) corresponding to the translation vector of the board.
  451. *
  452. * This function estimates a Charuco board pose from some detected corners.
  453. * The function checks if the input corners are enough and valid to perform pose estimation.
  454. * If pose estimation is valid, returns true, else returns false.
  455. * SEE: use cv::drawFrameAxes to get world coordinate system axis for object points
  456. * return automatically generated
  457. */
  458. public static bool estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat rvec, Mat tvec)
  459. {
  460. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  461. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  462. if (board != null) board.ThrowIfDisposed();
  463. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  464. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  465. if (rvec != null) rvec.ThrowIfDisposed();
  466. if (tvec != null) tvec.ThrowIfDisposed();
  467. return aruco_Aruco_estimatePoseCharucoBoard_11(charucoCorners.nativeObj, charucoIds.nativeObj, board.getNativeObjAddr(), cameraMatrix.nativeObj, distCoeffs.nativeObj, rvec.nativeObj, tvec.nativeObj);
  468. }
  469. //
  470. // C++: void cv::aruco::estimatePoseSingleMarkers(vector_Mat corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat& rvecs, Mat& tvecs, Mat& objPoints = Mat(), Ptr_EstimateParameters estimateParameters = makePtr<EstimateParameters>())
  471. //
  472. /**
  473. * deprecated Use cv::solvePnP
  474. * param corners automatically generated
  475. * param markerLength automatically generated
  476. * param cameraMatrix automatically generated
  477. * param distCoeffs automatically generated
  478. * param rvecs automatically generated
  479. * param tvecs automatically generated
  480. * param objPoints automatically generated
  481. * param estimateParameters automatically generated
  482. */
  483. [Obsolete("This method is deprecated.")]
  484. public static void estimatePoseSingleMarkers(List<Mat> corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs, Mat objPoints, EstimateParameters estimateParameters)
  485. {
  486. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  487. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  488. if (rvecs != null) rvecs.ThrowIfDisposed();
  489. if (tvecs != null) tvecs.ThrowIfDisposed();
  490. if (objPoints != null) objPoints.ThrowIfDisposed();
  491. if (estimateParameters != null) estimateParameters.ThrowIfDisposed();
  492. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  493. aruco_Aruco_estimatePoseSingleMarkers_10(corners_mat.nativeObj, markerLength, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs.nativeObj, tvecs.nativeObj, objPoints.nativeObj, estimateParameters.getNativeObjAddr());
  494. }
  495. /**
  496. * deprecated Use cv::solvePnP
  497. * param corners automatically generated
  498. * param markerLength automatically generated
  499. * param cameraMatrix automatically generated
  500. * param distCoeffs automatically generated
  501. * param rvecs automatically generated
  502. * param tvecs automatically generated
  503. * param objPoints automatically generated
  504. */
  505. [Obsolete("This method is deprecated.")]
  506. public static void estimatePoseSingleMarkers(List<Mat> corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs, Mat objPoints)
  507. {
  508. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  509. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  510. if (rvecs != null) rvecs.ThrowIfDisposed();
  511. if (tvecs != null) tvecs.ThrowIfDisposed();
  512. if (objPoints != null) objPoints.ThrowIfDisposed();
  513. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  514. aruco_Aruco_estimatePoseSingleMarkers_11(corners_mat.nativeObj, markerLength, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs.nativeObj, tvecs.nativeObj, objPoints.nativeObj);
  515. }
  516. /**
  517. * deprecated Use cv::solvePnP
  518. * param corners automatically generated
  519. * param markerLength automatically generated
  520. * param cameraMatrix automatically generated
  521. * param distCoeffs automatically generated
  522. * param rvecs automatically generated
  523. * param tvecs automatically generated
  524. */
  525. [Obsolete("This method is deprecated.")]
  526. public static void estimatePoseSingleMarkers(List<Mat> corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat rvecs, Mat tvecs)
  527. {
  528. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  529. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  530. if (rvecs != null) rvecs.ThrowIfDisposed();
  531. if (tvecs != null) tvecs.ThrowIfDisposed();
  532. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  533. aruco_Aruco_estimatePoseSingleMarkers_12(corners_mat.nativeObj, markerLength, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs.nativeObj, tvecs.nativeObj);
  534. }
  535. //
  536. // C++: bool cv::aruco::testCharucoCornersCollinear(Ptr_CharucoBoard board, Mat charucoIds)
  537. //
  538. /**
  539. * deprecated Use CharucoBoard::checkCharucoCornersCollinear
  540. * param board automatically generated
  541. * param charucoIds automatically generated
  542. * return automatically generated
  543. */
  544. [Obsolete("This method is deprecated.")]
  545. public static bool testCharucoCornersCollinear(CharucoBoard board, Mat charucoIds)
  546. {
  547. if (board != null) board.ThrowIfDisposed();
  548. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  549. return aruco_Aruco_testCharucoCornersCollinear_10(board.getNativeObjAddr(), charucoIds.nativeObj);
  550. }
  551. //
  552. // C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  553. //
  554. /**
  555. * Calibrate a camera using aruco markers
  556. *
  557. * param corners vector of detected marker corners in all frames.
  558. * The corners should have the same format returned by detectMarkers (see #detectMarkers).
  559. * param ids list of identifiers for each marker in corners
  560. * param counter number of markers in each frame so that corners and ids can be split
  561. * param board Marker Board layout
  562. * param imageSize Size of the image used only to initialize the intrinsic camera matrix.
  563. * param cameraMatrix Output 3x3 floating-point camera matrix
  564. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  565. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  566. * initialized before calling the function.
  567. * param distCoeffs Output vector of distortion coefficients
  568. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  569. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  570. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  571. * k-th translation vector (see the next output parameter description) brings the board pattern
  572. * from the model coordinate space (in which object points are specified) to the world coordinate
  573. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  574. * param tvecs Output vector of translation vectors estimated for each pattern view.
  575. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  576. * Order of deviations values:
  577. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  578. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  579. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  580. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  581. * \(R_i, T_i\) are concatenated 1x3 vectors.
  582. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  583. * param flags flags Different flags for the calibration process (see #calibrateCamera for details).
  584. * param criteria Termination criteria for the iterative optimization algorithm.
  585. *
  586. * This function calibrates a camera using an Aruco Board. The function receives a list of
  587. * detected markers from several views of the Board. The process is similar to the chessboard
  588. * calibration in calibrateCamera(). The function returns the final re-projection error.
  589. * return automatically generated
  590. */
  591. public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags, TermCriteria criteria)
  592. {
  593. if (ids != null) ids.ThrowIfDisposed();
  594. if (counter != null) counter.ThrowIfDisposed();
  595. if (board != null) board.ThrowIfDisposed();
  596. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  597. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  598. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  599. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  600. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  601. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  602. Mat rvecs_mat = new Mat();
  603. Mat tvecs_mat = new Mat();
  604. double retVal = aruco_Aruco_calibrateCameraArucoExtended_10(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon);
  605. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  606. rvecs_mat.release();
  607. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  608. tvecs_mat.release();
  609. return retVal;
  610. }
  611. /**
  612. * Calibrate a camera using aruco markers
  613. *
  614. * param corners vector of detected marker corners in all frames.
  615. * The corners should have the same format returned by detectMarkers (see #detectMarkers).
  616. * param ids list of identifiers for each marker in corners
  617. * param counter number of markers in each frame so that corners and ids can be split
  618. * param board Marker Board layout
  619. * param imageSize Size of the image used only to initialize the intrinsic camera matrix.
  620. * param cameraMatrix Output 3x3 floating-point camera matrix
  621. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  622. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  623. * initialized before calling the function.
  624. * param distCoeffs Output vector of distortion coefficients
  625. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  626. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  627. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  628. * k-th translation vector (see the next output parameter description) brings the board pattern
  629. * from the model coordinate space (in which object points are specified) to the world coordinate
  630. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  631. * param tvecs Output vector of translation vectors estimated for each pattern view.
  632. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  633. * Order of deviations values:
  634. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  635. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  636. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  637. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  638. * \(R_i, T_i\) are concatenated 1x3 vectors.
  639. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  640. * param flags flags Different flags for the calibration process (see #calibrateCamera for details).
  641. *
  642. * This function calibrates a camera using an Aruco Board. The function receives a list of
  643. * detected markers from several views of the Board. The process is similar to the chessboard
  644. * calibration in calibrateCamera(). The function returns the final re-projection error.
  645. * return automatically generated
  646. */
  647. public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags)
  648. {
  649. if (ids != null) ids.ThrowIfDisposed();
  650. if (counter != null) counter.ThrowIfDisposed();
  651. if (board != null) board.ThrowIfDisposed();
  652. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  653. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  654. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  655. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  656. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  657. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  658. Mat rvecs_mat = new Mat();
  659. Mat tvecs_mat = new Mat();
  660. double retVal = aruco_Aruco_calibrateCameraArucoExtended_11(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags);
  661. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  662. rvecs_mat.release();
  663. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  664. tvecs_mat.release();
  665. return retVal;
  666. }
  667. /**
  668. * Calibrate a camera using aruco markers
  669. *
  670. * param corners vector of detected marker corners in all frames.
  671. * The corners should have the same format returned by detectMarkers (see #detectMarkers).
  672. * param ids list of identifiers for each marker in corners
  673. * param counter number of markers in each frame so that corners and ids can be split
  674. * param board Marker Board layout
  675. * param imageSize Size of the image used only to initialize the intrinsic camera matrix.
  676. * param cameraMatrix Output 3x3 floating-point camera matrix
  677. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  678. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  679. * initialized before calling the function.
  680. * param distCoeffs Output vector of distortion coefficients
  681. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  682. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  683. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  684. * k-th translation vector (see the next output parameter description) brings the board pattern
  685. * from the model coordinate space (in which object points are specified) to the world coordinate
  686. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  687. * param tvecs Output vector of translation vectors estimated for each pattern view.
  688. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  689. * Order of deviations values:
  690. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  691. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  692. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  693. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  694. * \(R_i, T_i\) are concatenated 1x3 vectors.
  695. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  696. *
  697. * This function calibrates a camera using an Aruco Board. The function receives a list of
  698. * detected markers from several views of the Board. The process is similar to the chessboard
  699. * calibration in calibrateCamera(). The function returns the final re-projection error.
  700. * return automatically generated
  701. */
  702. public static double calibrateCameraArucoExtended(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors)
  703. {
  704. if (ids != null) ids.ThrowIfDisposed();
  705. if (counter != null) counter.ThrowIfDisposed();
  706. if (board != null) board.ThrowIfDisposed();
  707. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  708. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  709. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  710. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  711. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  712. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  713. Mat rvecs_mat = new Mat();
  714. Mat tvecs_mat = new Mat();
  715. double retVal = aruco_Aruco_calibrateCameraArucoExtended_12(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj);
  716. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  717. rvecs_mat.release();
  718. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  719. tvecs_mat.release();
  720. return retVal;
  721. }
  722. //
  723. // C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  724. //
  725. /**
  726. *
  727. * It's the same function as #calibrateCameraAruco but without calibration error estimation.
  728. * param corners automatically generated
  729. * param ids automatically generated
  730. * param counter automatically generated
  731. * param board automatically generated
  732. * param imageSize automatically generated
  733. * param cameraMatrix automatically generated
  734. * param distCoeffs automatically generated
  735. * param rvecs automatically generated
  736. * param tvecs automatically generated
  737. * param flags automatically generated
  738. * param criteria automatically generated
  739. * return automatically generated
  740. */
  741. public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria)
  742. {
  743. if (ids != null) ids.ThrowIfDisposed();
  744. if (counter != null) counter.ThrowIfDisposed();
  745. if (board != null) board.ThrowIfDisposed();
  746. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  747. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  748. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  749. Mat rvecs_mat = new Mat();
  750. Mat tvecs_mat = new Mat();
  751. double retVal = aruco_Aruco_calibrateCameraAruco_10(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon);
  752. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  753. rvecs_mat.release();
  754. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  755. tvecs_mat.release();
  756. return retVal;
  757. }
  758. /**
  759. *
  760. * It's the same function as #calibrateCameraAruco but without calibration error estimation.
  761. * param corners automatically generated
  762. * param ids automatically generated
  763. * param counter automatically generated
  764. * param board automatically generated
  765. * param imageSize automatically generated
  766. * param cameraMatrix automatically generated
  767. * param distCoeffs automatically generated
  768. * param rvecs automatically generated
  769. * param tvecs automatically generated
  770. * param flags automatically generated
  771. * return automatically generated
  772. */
  773. public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags)
  774. {
  775. if (ids != null) ids.ThrowIfDisposed();
  776. if (counter != null) counter.ThrowIfDisposed();
  777. if (board != null) board.ThrowIfDisposed();
  778. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  779. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  780. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  781. Mat rvecs_mat = new Mat();
  782. Mat tvecs_mat = new Mat();
  783. double retVal = aruco_Aruco_calibrateCameraAruco_11(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags);
  784. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  785. rvecs_mat.release();
  786. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  787. tvecs_mat.release();
  788. return retVal;
  789. }
  790. /**
  791. *
  792. * It's the same function as #calibrateCameraAruco but without calibration error estimation.
  793. * param corners automatically generated
  794. * param ids automatically generated
  795. * param counter automatically generated
  796. * param board automatically generated
  797. * param imageSize automatically generated
  798. * param cameraMatrix automatically generated
  799. * param distCoeffs automatically generated
  800. * param rvecs automatically generated
  801. * param tvecs automatically generated
  802. * return automatically generated
  803. */
  804. public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs)
  805. {
  806. if (ids != null) ids.ThrowIfDisposed();
  807. if (counter != null) counter.ThrowIfDisposed();
  808. if (board != null) board.ThrowIfDisposed();
  809. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  810. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  811. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  812. Mat rvecs_mat = new Mat();
  813. Mat tvecs_mat = new Mat();
  814. double retVal = aruco_Aruco_calibrateCameraAruco_12(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj);
  815. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  816. rvecs_mat.release();
  817. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  818. tvecs_mat.release();
  819. return retVal;
  820. }
  821. /**
  822. *
  823. * It's the same function as #calibrateCameraAruco but without calibration error estimation.
  824. * param corners automatically generated
  825. * param ids automatically generated
  826. * param counter automatically generated
  827. * param board automatically generated
  828. * param imageSize automatically generated
  829. * param cameraMatrix automatically generated
  830. * param distCoeffs automatically generated
  831. * param rvecs automatically generated
  832. * return automatically generated
  833. */
  834. public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs)
  835. {
  836. if (ids != null) ids.ThrowIfDisposed();
  837. if (counter != null) counter.ThrowIfDisposed();
  838. if (board != null) board.ThrowIfDisposed();
  839. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  840. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  841. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  842. Mat rvecs_mat = new Mat();
  843. double retVal = aruco_Aruco_calibrateCameraAruco_13(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj);
  844. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  845. rvecs_mat.release();
  846. return retVal;
  847. }
  848. /**
  849. *
  850. * It's the same function as #calibrateCameraAruco but without calibration error estimation.
  851. * param corners automatically generated
  852. * param ids automatically generated
  853. * param counter automatically generated
  854. * param board automatically generated
  855. * param imageSize automatically generated
  856. * param cameraMatrix automatically generated
  857. * param distCoeffs automatically generated
  858. * return automatically generated
  859. */
  860. public static double calibrateCameraAruco(List<Mat> corners, Mat ids, Mat counter, Board board, Size imageSize, Mat cameraMatrix, Mat distCoeffs)
  861. {
  862. if (ids != null) ids.ThrowIfDisposed();
  863. if (counter != null) counter.ThrowIfDisposed();
  864. if (board != null) board.ThrowIfDisposed();
  865. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  866. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  867. Mat corners_mat = Converters.vector_Mat_to_Mat(corners);
  868. return aruco_Aruco_calibrateCameraAruco_14(corners_mat.nativeObj, ids.nativeObj, counter.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj);
  869. }
  870. //
  871. // C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  872. //
  873. /**
  874. * Calibrate a camera using Charuco corners
  875. *
  876. * param charucoCorners vector of detected charuco corners per frame
  877. * param charucoIds list of identifiers for each corner in charucoCorners per frame
  878. * param board Marker Board layout
  879. * param imageSize input image size
  880. * param cameraMatrix Output 3x3 floating-point camera matrix
  881. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  882. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  883. * initialized before calling the function.
  884. * param distCoeffs Output vector of distortion coefficients
  885. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  886. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  887. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  888. * k-th translation vector (see the next output parameter description) brings the board pattern
  889. * from the model coordinate space (in which object points are specified) to the world coordinate
  890. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  891. * param tvecs Output vector of translation vectors estimated for each pattern view.
  892. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  893. * Order of deviations values:
  894. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  895. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  896. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  897. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  898. * \(R_i, T_i\) are concatenated 1x3 vectors.
  899. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  900. * param flags flags Different flags for the calibration process (see #calibrateCamera for details).
  901. * param criteria Termination criteria for the iterative optimization algorithm.
  902. *
  903. * This function calibrates a camera using a set of corners of a Charuco Board. The function
  904. * receives a list of detected corners and its identifiers from several views of the Board.
  905. * The function returns the final re-projection error.
  906. * return automatically generated
  907. */
  908. public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags, TermCriteria criteria)
  909. {
  910. if (board != null) board.ThrowIfDisposed();
  911. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  912. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  913. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  914. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  915. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  916. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  917. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  918. Mat rvecs_mat = new Mat();
  919. Mat tvecs_mat = new Mat();
  920. double retVal = aruco_Aruco_calibrateCameraCharucoExtended_10(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon);
  921. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  922. rvecs_mat.release();
  923. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  924. tvecs_mat.release();
  925. return retVal;
  926. }
  927. /**
  928. * Calibrate a camera using Charuco corners
  929. *
  930. * param charucoCorners vector of detected charuco corners per frame
  931. * param charucoIds list of identifiers for each corner in charucoCorners per frame
  932. * param board Marker Board layout
  933. * param imageSize input image size
  934. * param cameraMatrix Output 3x3 floating-point camera matrix
  935. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  936. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  937. * initialized before calling the function.
  938. * param distCoeffs Output vector of distortion coefficients
  939. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  940. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  941. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  942. * k-th translation vector (see the next output parameter description) brings the board pattern
  943. * from the model coordinate space (in which object points are specified) to the world coordinate
  944. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  945. * param tvecs Output vector of translation vectors estimated for each pattern view.
  946. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  947. * Order of deviations values:
  948. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  949. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  950. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  951. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  952. * \(R_i, T_i\) are concatenated 1x3 vectors.
  953. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  954. * param flags flags Different flags for the calibration process (see #calibrateCamera for details).
  955. *
  956. * This function calibrates a camera using a set of corners of a Charuco Board. The function
  957. * receives a list of detected corners and its identifiers from several views of the Board.
  958. * The function returns the final re-projection error.
  959. * return automatically generated
  960. */
  961. public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags)
  962. {
  963. if (board != null) board.ThrowIfDisposed();
  964. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  965. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  966. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  967. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  968. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  969. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  970. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  971. Mat rvecs_mat = new Mat();
  972. Mat tvecs_mat = new Mat();
  973. double retVal = aruco_Aruco_calibrateCameraCharucoExtended_11(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags);
  974. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  975. rvecs_mat.release();
  976. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  977. tvecs_mat.release();
  978. return retVal;
  979. }
  980. /**
  981. * Calibrate a camera using Charuco corners
  982. *
  983. * param charucoCorners vector of detected charuco corners per frame
  984. * param charucoIds list of identifiers for each corner in charucoCorners per frame
  985. * param board Marker Board layout
  986. * param imageSize input image size
  987. * param cameraMatrix Output 3x3 floating-point camera matrix
  988. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\) . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
  989. * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
  990. * initialized before calling the function.
  991. * param distCoeffs Output vector of distortion coefficients
  992. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  993. * param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view
  994. * (e.g. std::vector&lt;cv::Mat&gt;&gt;). That is, each k-th rotation vector together with the corresponding
  995. * k-th translation vector (see the next output parameter description) brings the board pattern
  996. * from the model coordinate space (in which object points are specified) to the world coordinate
  997. * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
  998. * param tvecs Output vector of translation vectors estimated for each pattern view.
  999. * param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
  1000. * Order of deviations values:
  1001. * \((f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
  1002. * s_4, \tau_x, \tau_y)\) If one of parameters is not estimated, it's deviation is equals to zero.
  1003. * param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
  1004. * Order of deviations values: \((R_1, T_1, \dotsc , R_M, T_M)\) where M is number of pattern views,
  1005. * \(R_i, T_i\) are concatenated 1x3 vectors.
  1006. * param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
  1007. *
  1008. * This function calibrates a camera using a set of corners of a Charuco Board. The function
  1009. * receives a list of detected corners and its identifiers from several views of the Board.
  1010. * The function returns the final re-projection error.
  1011. * return automatically generated
  1012. */
  1013. public static double calibrateCameraCharucoExtended(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors)
  1014. {
  1015. if (board != null) board.ThrowIfDisposed();
  1016. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1017. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1018. if (stdDeviationsIntrinsics != null) stdDeviationsIntrinsics.ThrowIfDisposed();
  1019. if (stdDeviationsExtrinsics != null) stdDeviationsExtrinsics.ThrowIfDisposed();
  1020. if (perViewErrors != null) perViewErrors.ThrowIfDisposed();
  1021. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1022. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1023. Mat rvecs_mat = new Mat();
  1024. Mat tvecs_mat = new Mat();
  1025. double retVal = aruco_Aruco_calibrateCameraCharucoExtended_12(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj);
  1026. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  1027. rvecs_mat.release();
  1028. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  1029. tvecs_mat.release();
  1030. return retVal;
  1031. }
  1032. //
  1033. // C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  1034. //
  1035. /**
  1036. * It's the same function as #calibrateCameraCharuco but without calibration error estimation.
  1037. * param charucoCorners automatically generated
  1038. * param charucoIds automatically generated
  1039. * param board automatically generated
  1040. * param imageSize automatically generated
  1041. * param cameraMatrix automatically generated
  1042. * param distCoeffs automatically generated
  1043. * param rvecs automatically generated
  1044. * param tvecs automatically generated
  1045. * param flags automatically generated
  1046. * param criteria automatically generated
  1047. * return automatically generated
  1048. */
  1049. public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags, TermCriteria criteria)
  1050. {
  1051. if (board != null) board.ThrowIfDisposed();
  1052. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1053. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1054. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1055. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1056. Mat rvecs_mat = new Mat();
  1057. Mat tvecs_mat = new Mat();
  1058. double retVal = aruco_Aruco_calibrateCameraCharuco_10(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon);
  1059. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  1060. rvecs_mat.release();
  1061. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  1062. tvecs_mat.release();
  1063. return retVal;
  1064. }
  1065. /**
  1066. * It's the same function as #calibrateCameraCharuco but without calibration error estimation.
  1067. * param charucoCorners automatically generated
  1068. * param charucoIds automatically generated
  1069. * param board automatically generated
  1070. * param imageSize automatically generated
  1071. * param cameraMatrix automatically generated
  1072. * param distCoeffs automatically generated
  1073. * param rvecs automatically generated
  1074. * param tvecs automatically generated
  1075. * param flags automatically generated
  1076. * return automatically generated
  1077. */
  1078. public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, int flags)
  1079. {
  1080. if (board != null) board.ThrowIfDisposed();
  1081. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1082. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1083. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1084. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1085. Mat rvecs_mat = new Mat();
  1086. Mat tvecs_mat = new Mat();
  1087. double retVal = aruco_Aruco_calibrateCameraCharuco_11(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, flags);
  1088. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  1089. rvecs_mat.release();
  1090. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  1091. tvecs_mat.release();
  1092. return retVal;
  1093. }
  1094. /**
  1095. * It's the same function as #calibrateCameraCharuco but without calibration error estimation.
  1096. * param charucoCorners automatically generated
  1097. * param charucoIds automatically generated
  1098. * param board automatically generated
  1099. * param imageSize automatically generated
  1100. * param cameraMatrix automatically generated
  1101. * param distCoeffs automatically generated
  1102. * param rvecs automatically generated
  1103. * param tvecs automatically generated
  1104. * return automatically generated
  1105. */
  1106. public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs)
  1107. {
  1108. if (board != null) board.ThrowIfDisposed();
  1109. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1110. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1111. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1112. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1113. Mat rvecs_mat = new Mat();
  1114. Mat tvecs_mat = new Mat();
  1115. double retVal = aruco_Aruco_calibrateCameraCharuco_12(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj);
  1116. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  1117. rvecs_mat.release();
  1118. Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
  1119. tvecs_mat.release();
  1120. return retVal;
  1121. }
  1122. /**
  1123. * It's the same function as #calibrateCameraCharuco but without calibration error estimation.
  1124. * param charucoCorners automatically generated
  1125. * param charucoIds automatically generated
  1126. * param board automatically generated
  1127. * param imageSize automatically generated
  1128. * param cameraMatrix automatically generated
  1129. * param distCoeffs automatically generated
  1130. * param rvecs automatically generated
  1131. * return automatically generated
  1132. */
  1133. public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs)
  1134. {
  1135. if (board != null) board.ThrowIfDisposed();
  1136. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1137. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1138. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1139. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1140. Mat rvecs_mat = new Mat();
  1141. double retVal = aruco_Aruco_calibrateCameraCharuco_13(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj);
  1142. Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
  1143. rvecs_mat.release();
  1144. return retVal;
  1145. }
  1146. /**
  1147. * It's the same function as #calibrateCameraCharuco but without calibration error estimation.
  1148. * param charucoCorners automatically generated
  1149. * param charucoIds automatically generated
  1150. * param board automatically generated
  1151. * param imageSize automatically generated
  1152. * param cameraMatrix automatically generated
  1153. * param distCoeffs automatically generated
  1154. * return automatically generated
  1155. */
  1156. public static double calibrateCameraCharuco(List<Mat> charucoCorners, List<Mat> charucoIds, CharucoBoard board, Size imageSize, Mat cameraMatrix, Mat distCoeffs)
  1157. {
  1158. if (board != null) board.ThrowIfDisposed();
  1159. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1160. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1161. Mat charucoCorners_mat = Converters.vector_Mat_to_Mat(charucoCorners);
  1162. Mat charucoIds_mat = Converters.vector_Mat_to_Mat(charucoIds);
  1163. return aruco_Aruco_calibrateCameraCharuco_14(charucoCorners_mat.nativeObj, charucoIds_mat.nativeObj, board.getNativeObjAddr(), imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj);
  1164. }
  1165. //
  1166. // C++: int cv::aruco::interpolateCornersCharuco(vector_Mat markerCorners, Mat markerIds, Mat image, Ptr_CharucoBoard board, Mat& charucoCorners, Mat& charucoIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), int minMarkers = 2)
  1167. //
  1168. /**
  1169. * Interpolate position of ChArUco board corners
  1170. * param markerCorners vector of already detected markers corners. For each marker, its four
  1171. * corners are provided, (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the
  1172. * dimensions of this array should be Nx4. The order of the corners should be clockwise.
  1173. * param markerIds list of identifiers for each marker in corners
  1174. * param image input image necesary for corner refinement. Note that markers are not detected and
  1175. * should be sent in corners and ids parameters.
  1176. * param board layout of ChArUco board.
  1177. * param charucoCorners interpolated chessboard corners
  1178. * param charucoIds interpolated chessboard corners identifiers
  1179. * param cameraMatrix optional 3x3 floating-point camera matrix
  1180. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  1181. * param distCoeffs optional vector of distortion coefficients
  1182. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  1183. * param minMarkers number of adjacent markers that must be detected to return a charuco corner
  1184. *
  1185. * This function receives the detected markers and returns the 2D position of the chessboard corners
  1186. * from a ChArUco board using the detected Aruco markers. If camera parameters are provided,
  1187. * the process is based in an approximated pose estimation, else it is based on local homography.
  1188. * Only visible corners are returned. For each corner, its corresponding identifier is
  1189. * also returned in charucoIds.
  1190. * The function returns the number of interpolated corners.
  1191. *
  1192. * deprecated Use CharucoDetector::detectBoard
  1193. * return automatically generated
  1194. */
  1195. [Obsolete("This method is deprecated.")]
  1196. public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix, Mat distCoeffs, int minMarkers)
  1197. {
  1198. if (markerIds != null) markerIds.ThrowIfDisposed();
  1199. if (image != null) image.ThrowIfDisposed();
  1200. if (board != null) board.ThrowIfDisposed();
  1201. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  1202. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  1203. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1204. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1205. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1206. return aruco_Aruco_interpolateCornersCharuco_10(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, minMarkers);
  1207. }
  1208. /**
  1209. * Interpolate position of ChArUco board corners
  1210. * param markerCorners vector of already detected markers corners. For each marker, its four
  1211. * corners are provided, (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the
  1212. * dimensions of this array should be Nx4. The order of the corners should be clockwise.
  1213. * param markerIds list of identifiers for each marker in corners
  1214. * param image input image necesary for corner refinement. Note that markers are not detected and
  1215. * should be sent in corners and ids parameters.
  1216. * param board layout of ChArUco board.
  1217. * param charucoCorners interpolated chessboard corners
  1218. * param charucoIds interpolated chessboard corners identifiers
  1219. * param cameraMatrix optional 3x3 floating-point camera matrix
  1220. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  1221. * param distCoeffs optional vector of distortion coefficients
  1222. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  1223. *
  1224. * This function receives the detected markers and returns the 2D position of the chessboard corners
  1225. * from a ChArUco board using the detected Aruco markers. If camera parameters are provided,
  1226. * the process is based in an approximated pose estimation, else it is based on local homography.
  1227. * Only visible corners are returned. For each corner, its corresponding identifier is
  1228. * also returned in charucoIds.
  1229. * The function returns the number of interpolated corners.
  1230. *
  1231. * deprecated Use CharucoDetector::detectBoard
  1232. * return automatically generated
  1233. */
  1234. [Obsolete("This method is deprecated.")]
  1235. public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix, Mat distCoeffs)
  1236. {
  1237. if (markerIds != null) markerIds.ThrowIfDisposed();
  1238. if (image != null) image.ThrowIfDisposed();
  1239. if (board != null) board.ThrowIfDisposed();
  1240. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  1241. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  1242. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1243. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1244. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1245. return aruco_Aruco_interpolateCornersCharuco_11(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
  1246. }
  1247. /**
  1248. * Interpolate position of ChArUco board corners
  1249. * param markerCorners vector of already detected markers corners. For each marker, its four
  1250. * corners are provided, (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the
  1251. * dimensions of this array should be Nx4. The order of the corners should be clockwise.
  1252. * param markerIds list of identifiers for each marker in corners
  1253. * param image input image necesary for corner refinement. Note that markers are not detected and
  1254. * should be sent in corners and ids parameters.
  1255. * param board layout of ChArUco board.
  1256. * param charucoCorners interpolated chessboard corners
  1257. * param charucoIds interpolated chessboard corners identifiers
  1258. * param cameraMatrix optional 3x3 floating-point camera matrix
  1259. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  1260. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  1261. *
  1262. * This function receives the detected markers and returns the 2D position of the chessboard corners
  1263. * from a ChArUco board using the detected Aruco markers. If camera parameters are provided,
  1264. * the process is based in an approximated pose estimation, else it is based on local homography.
  1265. * Only visible corners are returned. For each corner, its corresponding identifier is
  1266. * also returned in charucoIds.
  1267. * The function returns the number of interpolated corners.
  1268. *
  1269. * deprecated Use CharucoDetector::detectBoard
  1270. * return automatically generated
  1271. */
  1272. [Obsolete("This method is deprecated.")]
  1273. public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds, Mat cameraMatrix)
  1274. {
  1275. if (markerIds != null) markerIds.ThrowIfDisposed();
  1276. if (image != null) image.ThrowIfDisposed();
  1277. if (board != null) board.ThrowIfDisposed();
  1278. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  1279. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  1280. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1281. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1282. return aruco_Aruco_interpolateCornersCharuco_12(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj, cameraMatrix.nativeObj);
  1283. }
  1284. /**
  1285. * Interpolate position of ChArUco board corners
  1286. * param markerCorners vector of already detected markers corners. For each marker, its four
  1287. * corners are provided, (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ). For N detected markers, the
  1288. * dimensions of this array should be Nx4. The order of the corners should be clockwise.
  1289. * param markerIds list of identifiers for each marker in corners
  1290. * param image input image necesary for corner refinement. Note that markers are not detected and
  1291. * should be sent in corners and ids parameters.
  1292. * param board layout of ChArUco board.
  1293. * param charucoCorners interpolated chessboard corners
  1294. * param charucoIds interpolated chessboard corners identifiers
  1295. * \(A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\)
  1296. * \((k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\) of 4, 5, 8 or 12 elements
  1297. *
  1298. * This function receives the detected markers and returns the 2D position of the chessboard corners
  1299. * from a ChArUco board using the detected Aruco markers. If camera parameters are provided,
  1300. * the process is based in an approximated pose estimation, else it is based on local homography.
  1301. * Only visible corners are returned. For each corner, its corresponding identifier is
  1302. * also returned in charucoIds.
  1303. * The function returns the number of interpolated corners.
  1304. *
  1305. * deprecated Use CharucoDetector::detectBoard
  1306. * return automatically generated
  1307. */
  1308. [Obsolete("This method is deprecated.")]
  1309. public static int interpolateCornersCharuco(List<Mat> markerCorners, Mat markerIds, Mat image, CharucoBoard board, Mat charucoCorners, Mat charucoIds)
  1310. {
  1311. if (markerIds != null) markerIds.ThrowIfDisposed();
  1312. if (image != null) image.ThrowIfDisposed();
  1313. if (board != null) board.ThrowIfDisposed();
  1314. if (charucoCorners != null) charucoCorners.ThrowIfDisposed();
  1315. if (charucoIds != null) charucoIds.ThrowIfDisposed();
  1316. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1317. return aruco_Aruco_interpolateCornersCharuco_13(markerCorners_mat.nativeObj, markerIds.nativeObj, image.nativeObj, board.getNativeObjAddr(), charucoCorners.nativeObj, charucoIds.nativeObj);
  1318. }
  1319. //
  1320. // C++: void cv::aruco::detectCharucoDiamond(Mat image, vector_Mat markerCorners, Mat markerIds, float squareMarkerLengthRate, vector_Mat& diamondCorners, Mat& diamondIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), Ptr_Dictionary dictionary = makePtr<Dictionary> (getPredefinedDictionary(PredefinedDictionaryType::DICT_4X4_50)))
  1321. //
  1322. /**
  1323. * Detect ChArUco Diamond markers
  1324. *
  1325. * param image input image necessary for corner subpixel.
  1326. * param markerCorners list of detected marker corners from detectMarkers function.
  1327. * param markerIds list of marker ids in markerCorners.
  1328. * param squareMarkerLengthRate rate between square and marker length:
  1329. * squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
  1330. * param diamondCorners output list of detected diamond corners (4 corners per diamond). The order
  1331. * is the same than in marker corners: top left, top right, bottom right and bottom left. Similar
  1332. * format than the corners returned by detectMarkers (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ).
  1333. * param diamondIds ids of the diamonds in diamondCorners. The id of each diamond is in fact of
  1334. * type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the
  1335. * diamond.
  1336. * param cameraMatrix Optional camera calibration matrix.
  1337. * param distCoeffs Optional camera distortion coefficients.
  1338. * param dictionary dictionary of markers indicating the type of markers.
  1339. *
  1340. * This function detects Diamond markers from the previous detected ArUco markers. The diamonds
  1341. * are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters
  1342. * are provided, the diamond search is based on reprojection. If not, diamond search is based on
  1343. * homography. Homography is faster than reprojection, but less accurate.
  1344. *
  1345. * deprecated Use CharucoDetector::detectDiamonds
  1346. */
  1347. [Obsolete("This method is deprecated.")]
  1348. public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds, Mat cameraMatrix, Mat distCoeffs, Dictionary dictionary)
  1349. {
  1350. if (image != null) image.ThrowIfDisposed();
  1351. if (markerIds != null) markerIds.ThrowIfDisposed();
  1352. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  1353. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1354. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1355. if (dictionary != null) dictionary.ThrowIfDisposed();
  1356. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1357. Mat diamondCorners_mat = new Mat();
  1358. aruco_Aruco_detectCharucoDiamond_10(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj, dictionary.getNativeObjAddr());
  1359. Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
  1360. diamondCorners_mat.release();
  1361. }
  1362. /**
  1363. * Detect ChArUco Diamond markers
  1364. *
  1365. * param image input image necessary for corner subpixel.
  1366. * param markerCorners list of detected marker corners from detectMarkers function.
  1367. * param markerIds list of marker ids in markerCorners.
  1368. * param squareMarkerLengthRate rate between square and marker length:
  1369. * squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
  1370. * param diamondCorners output list of detected diamond corners (4 corners per diamond). The order
  1371. * is the same than in marker corners: top left, top right, bottom right and bottom left. Similar
  1372. * format than the corners returned by detectMarkers (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ).
  1373. * param diamondIds ids of the diamonds in diamondCorners. The id of each diamond is in fact of
  1374. * type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the
  1375. * diamond.
  1376. * param cameraMatrix Optional camera calibration matrix.
  1377. * param distCoeffs Optional camera distortion coefficients.
  1378. *
  1379. * This function detects Diamond markers from the previous detected ArUco markers. The diamonds
  1380. * are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters
  1381. * are provided, the diamond search is based on reprojection. If not, diamond search is based on
  1382. * homography. Homography is faster than reprojection, but less accurate.
  1383. *
  1384. * deprecated Use CharucoDetector::detectDiamonds
  1385. */
  1386. [Obsolete("This method is deprecated.")]
  1387. public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds, Mat cameraMatrix, Mat distCoeffs)
  1388. {
  1389. if (image != null) image.ThrowIfDisposed();
  1390. if (markerIds != null) markerIds.ThrowIfDisposed();
  1391. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  1392. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1393. if (distCoeffs != null) distCoeffs.ThrowIfDisposed();
  1394. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1395. Mat diamondCorners_mat = new Mat();
  1396. aruco_Aruco_detectCharucoDiamond_11(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj, cameraMatrix.nativeObj, distCoeffs.nativeObj);
  1397. Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
  1398. diamondCorners_mat.release();
  1399. }
  1400. /**
  1401. * Detect ChArUco Diamond markers
  1402. *
  1403. * param image input image necessary for corner subpixel.
  1404. * param markerCorners list of detected marker corners from detectMarkers function.
  1405. * param markerIds list of marker ids in markerCorners.
  1406. * param squareMarkerLengthRate rate between square and marker length:
  1407. * squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
  1408. * param diamondCorners output list of detected diamond corners (4 corners per diamond). The order
  1409. * is the same than in marker corners: top left, top right, bottom right and bottom left. Similar
  1410. * format than the corners returned by detectMarkers (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ).
  1411. * param diamondIds ids of the diamonds in diamondCorners. The id of each diamond is in fact of
  1412. * type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the
  1413. * diamond.
  1414. * param cameraMatrix Optional camera calibration matrix.
  1415. *
  1416. * This function detects Diamond markers from the previous detected ArUco markers. The diamonds
  1417. * are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters
  1418. * are provided, the diamond search is based on reprojection. If not, diamond search is based on
  1419. * homography. Homography is faster than reprojection, but less accurate.
  1420. *
  1421. * deprecated Use CharucoDetector::detectDiamonds
  1422. */
  1423. [Obsolete("This method is deprecated.")]
  1424. public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds, Mat cameraMatrix)
  1425. {
  1426. if (image != null) image.ThrowIfDisposed();
  1427. if (markerIds != null) markerIds.ThrowIfDisposed();
  1428. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  1429. if (cameraMatrix != null) cameraMatrix.ThrowIfDisposed();
  1430. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1431. Mat diamondCorners_mat = new Mat();
  1432. aruco_Aruco_detectCharucoDiamond_12(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj, cameraMatrix.nativeObj);
  1433. Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
  1434. diamondCorners_mat.release();
  1435. }
  1436. /**
  1437. * Detect ChArUco Diamond markers
  1438. *
  1439. * param image input image necessary for corner subpixel.
  1440. * param markerCorners list of detected marker corners from detectMarkers function.
  1441. * param markerIds list of marker ids in markerCorners.
  1442. * param squareMarkerLengthRate rate between square and marker length:
  1443. * squareMarkerLengthRate = squareLength/markerLength. The real units are not necessary.
  1444. * param diamondCorners output list of detected diamond corners (4 corners per diamond). The order
  1445. * is the same than in marker corners: top left, top right, bottom right and bottom left. Similar
  1446. * format than the corners returned by detectMarkers (e.g std::vector&lt;std::vector&lt;cv::Point2f&gt; &gt; ).
  1447. * param diamondIds ids of the diamonds in diamondCorners. The id of each diamond is in fact of
  1448. * type Vec4i, so each diamond has 4 ids, which are the ids of the aruco markers composing the
  1449. * diamond.
  1450. *
  1451. * This function detects Diamond markers from the previous detected ArUco markers. The diamonds
  1452. * are returned in the diamondCorners and diamondIds parameters. If camera calibration parameters
  1453. * are provided, the diamond search is based on reprojection. If not, diamond search is based on
  1454. * homography. Homography is faster than reprojection, but less accurate.
  1455. *
  1456. * deprecated Use CharucoDetector::detectDiamonds
  1457. */
  1458. [Obsolete("This method is deprecated.")]
  1459. public static void detectCharucoDiamond(Mat image, List<Mat> markerCorners, Mat markerIds, float squareMarkerLengthRate, List<Mat> diamondCorners, Mat diamondIds)
  1460. {
  1461. if (image != null) image.ThrowIfDisposed();
  1462. if (markerIds != null) markerIds.ThrowIfDisposed();
  1463. if (diamondIds != null) diamondIds.ThrowIfDisposed();
  1464. Mat markerCorners_mat = Converters.vector_Mat_to_Mat(markerCorners);
  1465. Mat diamondCorners_mat = new Mat();
  1466. aruco_Aruco_detectCharucoDiamond_13(image.nativeObj, markerCorners_mat.nativeObj, markerIds.nativeObj, squareMarkerLengthRate, diamondCorners_mat.nativeObj, diamondIds.nativeObj);
  1467. Converters.Mat_to_vector_Mat(diamondCorners_mat, diamondCorners);
  1468. diamondCorners_mat.release();
  1469. }
  1470. //
  1471. // C++: void cv::aruco::drawCharucoDiamond(Ptr_Dictionary dictionary, Vec4i ids, int squareLength, int markerLength, Mat& img, int marginSize = 0, int borderBits = 1)
  1472. //
  1473. // Unknown type 'Vec4i' (I), skipping the function
  1474. #if (UNITY_IOS || UNITY_WEBGL) && !UNITY_EDITOR
  1475. const string LIBNAME = "__Internal";
  1476. #else
  1477. const string LIBNAME = "opencvforunity";
  1478. #endif
  1479. // C++: void cv::aruco::detectMarkers(Mat image, Ptr_Dictionary dictionary, vector_Mat& corners, Mat& ids, Ptr_DetectorParameters parameters = makePtr<DetectorParameters>(), vector_Mat& rejectedImgPoints = vector_Mat())
  1480. [DllImport(LIBNAME)]
  1481. private static extern void aruco_Aruco_detectMarkers_10(IntPtr image_nativeObj, IntPtr dictionary_nativeObj, IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr parameters_nativeObj, IntPtr rejectedImgPoints_mat_nativeObj);
  1482. [DllImport(LIBNAME)]
  1483. private static extern void aruco_Aruco_detectMarkers_11(IntPtr image_nativeObj, IntPtr dictionary_nativeObj, IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr parameters_nativeObj);
  1484. [DllImport(LIBNAME)]
  1485. private static extern void aruco_Aruco_detectMarkers_12(IntPtr image_nativeObj, IntPtr dictionary_nativeObj, IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj);
  1486. // C++: void cv::aruco::refineDetectedMarkers(Mat image, Ptr_Board board, vector_Mat& detectedCorners, Mat& detectedIds, vector_Mat& rejectedCorners, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), float minRepDistance = 10.f, float errorCorrectionRate = 3.f, bool checkAllOrders = true, Mat& recoveredIdxs = Mat(), Ptr_DetectorParameters parameters = makePtr<DetectorParameters>())
  1487. [DllImport(LIBNAME)]
  1488. private static extern void aruco_Aruco_refineDetectedMarkers_10(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, [MarshalAs(UnmanagedType.U1)] bool checkAllOrders, IntPtr recoveredIdxs_nativeObj, IntPtr parameters_nativeObj);
  1489. [DllImport(LIBNAME)]
  1490. private static extern void aruco_Aruco_refineDetectedMarkers_11(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, [MarshalAs(UnmanagedType.U1)] bool checkAllOrders, IntPtr recoveredIdxs_nativeObj);
  1491. [DllImport(LIBNAME)]
  1492. private static extern void aruco_Aruco_refineDetectedMarkers_12(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate, [MarshalAs(UnmanagedType.U1)] bool checkAllOrders);
  1493. [DllImport(LIBNAME)]
  1494. private static extern void aruco_Aruco_refineDetectedMarkers_13(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, float minRepDistance, float errorCorrectionRate);
  1495. [DllImport(LIBNAME)]
  1496. private static extern void aruco_Aruco_refineDetectedMarkers_14(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, float minRepDistance);
  1497. [DllImport(LIBNAME)]
  1498. private static extern void aruco_Aruco_refineDetectedMarkers_15(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj);
  1499. [DllImport(LIBNAME)]
  1500. private static extern void aruco_Aruco_refineDetectedMarkers_16(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj, IntPtr cameraMatrix_nativeObj);
  1501. [DllImport(LIBNAME)]
  1502. private static extern void aruco_Aruco_refineDetectedMarkers_17(IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr rejectedCorners_mat_nativeObj);
  1503. // C++: void cv::aruco::drawPlanarBoard(Ptr_Board board, Size outSize, Mat& img, int marginSize, int borderBits)
  1504. [DllImport(LIBNAME)]
  1505. private static extern void aruco_Aruco_drawPlanarBoard_10(IntPtr board_nativeObj, double outSize_width, double outSize_height, IntPtr img_nativeObj, int marginSize, int borderBits);
  1506. // C++: void cv::aruco::getBoardObjectAndImagePoints(Ptr_Board board, vector_Mat detectedCorners, Mat detectedIds, Mat& objPoints, Mat& imgPoints)
  1507. [DllImport(LIBNAME)]
  1508. private static extern void aruco_Aruco_getBoardObjectAndImagePoints_10(IntPtr board_nativeObj, IntPtr detectedCorners_mat_nativeObj, IntPtr detectedIds_nativeObj, IntPtr objPoints_nativeObj, IntPtr imgPoints_nativeObj);
  1509. // C++: int cv::aruco::estimatePoseBoard(vector_Mat corners, Mat ids, Ptr_Board board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
  1510. [DllImport(LIBNAME)]
  1511. private static extern int aruco_Aruco_estimatePoseBoard_10(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr board_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvec_nativeObj, IntPtr tvec_nativeObj, [MarshalAs(UnmanagedType.U1)] bool useExtrinsicGuess);
  1512. [DllImport(LIBNAME)]
  1513. private static extern int aruco_Aruco_estimatePoseBoard_11(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr board_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvec_nativeObj, IntPtr tvec_nativeObj);
  1514. // C++: bool cv::aruco::estimatePoseCharucoBoard(Mat charucoCorners, Mat charucoIds, Ptr_CharucoBoard board, Mat cameraMatrix, Mat distCoeffs, Mat& rvec, Mat& tvec, bool useExtrinsicGuess = false)
  1515. [DllImport(LIBNAME)]
  1516. [return: MarshalAs(UnmanagedType.U1)]
  1517. private static extern bool aruco_Aruco_estimatePoseCharucoBoard_10(IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, IntPtr board_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvec_nativeObj, IntPtr tvec_nativeObj, [MarshalAs(UnmanagedType.U1)] bool useExtrinsicGuess);
  1518. [DllImport(LIBNAME)]
  1519. [return: MarshalAs(UnmanagedType.U1)]
  1520. private static extern bool aruco_Aruco_estimatePoseCharucoBoard_11(IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, IntPtr board_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvec_nativeObj, IntPtr tvec_nativeObj);
  1521. // C++: void cv::aruco::estimatePoseSingleMarkers(vector_Mat corners, float markerLength, Mat cameraMatrix, Mat distCoeffs, Mat& rvecs, Mat& tvecs, Mat& objPoints = Mat(), Ptr_EstimateParameters estimateParameters = makePtr<EstimateParameters>())
  1522. [DllImport(LIBNAME)]
  1523. private static extern void aruco_Aruco_estimatePoseSingleMarkers_10(IntPtr corners_mat_nativeObj, float markerLength, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_nativeObj, IntPtr tvecs_nativeObj, IntPtr objPoints_nativeObj, IntPtr estimateParameters_nativeObj);
  1524. [DllImport(LIBNAME)]
  1525. private static extern void aruco_Aruco_estimatePoseSingleMarkers_11(IntPtr corners_mat_nativeObj, float markerLength, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_nativeObj, IntPtr tvecs_nativeObj, IntPtr objPoints_nativeObj);
  1526. [DllImport(LIBNAME)]
  1527. private static extern void aruco_Aruco_estimatePoseSingleMarkers_12(IntPtr corners_mat_nativeObj, float markerLength, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_nativeObj, IntPtr tvecs_nativeObj);
  1528. // C++: bool cv::aruco::testCharucoCornersCollinear(Ptr_CharucoBoard board, Mat charucoIds)
  1529. [DllImport(LIBNAME)]
  1530. [return: MarshalAs(UnmanagedType.U1)]
  1531. private static extern bool aruco_Aruco_testCharucoCornersCollinear_10(IntPtr board_nativeObj, IntPtr charucoIds_nativeObj);
  1532. // C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  1533. [DllImport(LIBNAME)]
  1534. private static extern double aruco_Aruco_calibrateCameraArucoExtended_10(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
  1535. [DllImport(LIBNAME)]
  1536. private static extern double aruco_Aruco_calibrateCameraArucoExtended_11(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj, int flags);
  1537. [DllImport(LIBNAME)]
  1538. private static extern double aruco_Aruco_calibrateCameraArucoExtended_12(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj);
  1539. // C++: double cv::aruco::calibrateCameraAruco(vector_Mat corners, Mat ids, Mat counter, Ptr_Board board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  1540. [DllImport(LIBNAME)]
  1541. private static extern double aruco_Aruco_calibrateCameraAruco_10(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
  1542. [DllImport(LIBNAME)]
  1543. private static extern double aruco_Aruco_calibrateCameraAruco_11(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, int flags);
  1544. [DllImport(LIBNAME)]
  1545. private static extern double aruco_Aruco_calibrateCameraAruco_12(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj);
  1546. [DllImport(LIBNAME)]
  1547. private static extern double aruco_Aruco_calibrateCameraAruco_13(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj);
  1548. [DllImport(LIBNAME)]
  1549. private static extern double aruco_Aruco_calibrateCameraAruco_14(IntPtr corners_mat_nativeObj, IntPtr ids_nativeObj, IntPtr counter_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj);
  1550. // C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs, vector_Mat& tvecs, Mat& stdDeviationsIntrinsics, Mat& stdDeviationsExtrinsics, Mat& perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  1551. [DllImport(LIBNAME)]
  1552. private static extern double aruco_Aruco_calibrateCameraCharucoExtended_10(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
  1553. [DllImport(LIBNAME)]
  1554. private static extern double aruco_Aruco_calibrateCameraCharucoExtended_11(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj, int flags);
  1555. [DllImport(LIBNAME)]
  1556. private static extern double aruco_Aruco_calibrateCameraCharucoExtended_12(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, IntPtr stdDeviationsIntrinsics_nativeObj, IntPtr stdDeviationsExtrinsics_nativeObj, IntPtr perViewErrors_nativeObj);
  1557. // C++: double cv::aruco::calibrateCameraCharuco(vector_Mat charucoCorners, vector_Mat charucoIds, Ptr_CharucoBoard board, Size imageSize, Mat& cameraMatrix, Mat& distCoeffs, vector_Mat& rvecs = vector_Mat(), vector_Mat& tvecs = vector_Mat(), int flags = 0, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON))
  1558. [DllImport(LIBNAME)]
  1559. private static extern double aruco_Aruco_calibrateCameraCharuco_10(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, int flags, int criteria_type, int criteria_maxCount, double criteria_epsilon);
  1560. [DllImport(LIBNAME)]
  1561. private static extern double aruco_Aruco_calibrateCameraCharuco_11(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj, int flags);
  1562. [DllImport(LIBNAME)]
  1563. private static extern double aruco_Aruco_calibrateCameraCharuco_12(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj, IntPtr tvecs_mat_nativeObj);
  1564. [DllImport(LIBNAME)]
  1565. private static extern double aruco_Aruco_calibrateCameraCharuco_13(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr rvecs_mat_nativeObj);
  1566. [DllImport(LIBNAME)]
  1567. private static extern double aruco_Aruco_calibrateCameraCharuco_14(IntPtr charucoCorners_mat_nativeObj, IntPtr charucoIds_mat_nativeObj, IntPtr board_nativeObj, double imageSize_width, double imageSize_height, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj);
  1568. // C++: int cv::aruco::interpolateCornersCharuco(vector_Mat markerCorners, Mat markerIds, Mat image, Ptr_CharucoBoard board, Mat& charucoCorners, Mat& charucoIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), int minMarkers = 2)
  1569. [DllImport(LIBNAME)]
  1570. private static extern int aruco_Aruco_interpolateCornersCharuco_10(IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, int minMarkers);
  1571. [DllImport(LIBNAME)]
  1572. private static extern int aruco_Aruco_interpolateCornersCharuco_11(IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj);
  1573. [DllImport(LIBNAME)]
  1574. private static extern int aruco_Aruco_interpolateCornersCharuco_12(IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj, IntPtr cameraMatrix_nativeObj);
  1575. [DllImport(LIBNAME)]
  1576. private static extern int aruco_Aruco_interpolateCornersCharuco_13(IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, IntPtr image_nativeObj, IntPtr board_nativeObj, IntPtr charucoCorners_nativeObj, IntPtr charucoIds_nativeObj);
  1577. // C++: void cv::aruco::detectCharucoDiamond(Mat image, vector_Mat markerCorners, Mat markerIds, float squareMarkerLengthRate, vector_Mat& diamondCorners, Mat& diamondIds, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), Ptr_Dictionary dictionary = makePtr<Dictionary> (getPredefinedDictionary(PredefinedDictionaryType::DICT_4X4_50)))
  1578. [DllImport(LIBNAME)]
  1579. private static extern void aruco_Aruco_detectCharucoDiamond_10(IntPtr image_nativeObj, IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, float squareMarkerLengthRate, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj, IntPtr dictionary_nativeObj);
  1580. [DllImport(LIBNAME)]
  1581. private static extern void aruco_Aruco_detectCharucoDiamond_11(IntPtr image_nativeObj, IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, float squareMarkerLengthRate, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj, IntPtr cameraMatrix_nativeObj, IntPtr distCoeffs_nativeObj);
  1582. [DllImport(LIBNAME)]
  1583. private static extern void aruco_Aruco_detectCharucoDiamond_12(IntPtr image_nativeObj, IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, float squareMarkerLengthRate, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj, IntPtr cameraMatrix_nativeObj);
  1584. [DllImport(LIBNAME)]
  1585. private static extern void aruco_Aruco_detectCharucoDiamond_13(IntPtr image_nativeObj, IntPtr markerCorners_mat_nativeObj, IntPtr markerIds_nativeObj, float squareMarkerLengthRate, IntPtr diamondCorners_mat_nativeObj, IntPtr diamondIds_nativeObj);
  1586. }
  1587. }