ArucoDetector.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/objdetect.hpp"
  8. #import "opencv2/objdetect/aruco_detector.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Algorithm.h"
  14. @class Board;
  15. @class DetectorParameters;
  16. @class Dictionary;
  17. @class Mat;
  18. @class RefineParameters;
  19. NS_ASSUME_NONNULL_BEGIN
  20. // C++: class ArucoDetector
  21. /**
  22. * The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
  23. *
  24. * After detecting some markers in the image, you can try to find undetected markers from this dictionary with
  25. * refineDetectedMarkers() method.
  26. *
  27. * @see DetectorParameters, RefineParameters
  28. *
  29. * Member of `Objdetect`
  30. */
  31. CV_EXPORTS @interface ArucoDetector : Algorithm
  32. #ifdef __cplusplus
  33. @property(readonly)cv::Ptr<cv::aruco::ArucoDetector> nativePtrArucoDetector;
  34. #endif
  35. #ifdef __cplusplus
  36. - (instancetype)initWithNativePtr:(cv::Ptr<cv::aruco::ArucoDetector>)nativePtr;
  37. + (instancetype)fromNative:(cv::Ptr<cv::aruco::ArucoDetector>)nativePtr;
  38. #endif
  39. #pragma mark - Methods
  40. //
  41. // cv::aruco::ArucoDetector::ArucoDetector( _hidden_ dictionary = getPredefinedDictionary(cv::aruco::DICT_4X4_50), DetectorParameters detectorParams = DetectorParameters(), RefineParameters refineParams = RefineParameters())
  42. //
  43. /**
  44. * Basic ArucoDetector constructor
  45. *
  46. * @param dictionary indicates the type of markers that will be searched
  47. * @param detectorParams marker detection parameters
  48. * @param refineParams marker refine detection parameters
  49. */
  50. - (instancetype)initWithDictionary:(DetectorParameters*)detectorParams refineParams:(RefineParameters*)refineParams;
  51. /**
  52. * Basic ArucoDetector constructor
  53. *
  54. * @param dictionary indicates the type of markers that will be searched
  55. * @param detectorParams marker detection parameters
  56. */
  57. - (instancetype)initWithDictionary:(DetectorParameters*)detectorParams;
  58. /**
  59. * Basic ArucoDetector constructor
  60. *
  61. * @param dictionary indicates the type of markers that will be searched
  62. */
  63. - (instancetype)initWithDictionary;
  64. //
  65. // void cv::aruco::ArucoDetector::detectMarkers(Mat image, vector_Mat& corners, Mat& ids, vector_Mat& rejectedImgPoints = vector_Mat())
  66. //
  67. /**
  68. * Basic marker detection
  69. *
  70. * @param image input image
  71. * @param corners vector of detected marker corners. For each marker, its four corners
  72. * are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers,
  73. * the dimensions of this array is Nx4. The order of the corners is clockwise.
  74. * @param ids vector of identifiers of the detected markers. The identifier is of type int
  75. * (e.g. std::vector<int>). For N detected markers, the size of ids is also N.
  76. * The identifiers have the same order than the markers in the imgPoints array.
  77. * @param rejectedImgPoints contains the imgPoints of those squares whose inner code has not a
  78. * correct codification. Useful for debugging purposes.
  79. *
  80. * Performs marker detection in the input image. Only markers included in the specific dictionary
  81. * are searched. For each detected marker, it returns the 2D position of its corner in the image
  82. * and its corresponding identifier.
  83. * Note that this function does not perform pose estimation.
  84. * NOTE: The function does not correct lens distortion or takes it into account. It's recommended to undistort
  85. * input image with corresponding camera model, if camera parameters are known
  86. * @see `undistort`, `estimatePoseSingleMarkers`, `estimatePoseBoard`
  87. */
  88. - (void)detectMarkers:(Mat*)image corners:(NSMutableArray<Mat*>*)corners ids:(Mat*)ids rejectedImgPoints:(NSMutableArray<Mat*>*)rejectedImgPoints NS_SWIFT_NAME(detectMarkers(image:corners:ids:rejectedImgPoints:));
  89. /**
  90. * Basic marker detection
  91. *
  92. * @param image input image
  93. * @param corners vector of detected marker corners. For each marker, its four corners
  94. * are provided, (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers,
  95. * the dimensions of this array is Nx4. The order of the corners is clockwise.
  96. * @param ids vector of identifiers of the detected markers. The identifier is of type int
  97. * (e.g. std::vector<int>). For N detected markers, the size of ids is also N.
  98. * The identifiers have the same order than the markers in the imgPoints array.
  99. * correct codification. Useful for debugging purposes.
  100. *
  101. * Performs marker detection in the input image. Only markers included in the specific dictionary
  102. * are searched. For each detected marker, it returns the 2D position of its corner in the image
  103. * and its corresponding identifier.
  104. * Note that this function does not perform pose estimation.
  105. * NOTE: The function does not correct lens distortion or takes it into account. It's recommended to undistort
  106. * input image with corresponding camera model, if camera parameters are known
  107. * @see `undistort`, `estimatePoseSingleMarkers`, `estimatePoseBoard`
  108. */
  109. - (void)detectMarkers:(Mat*)image corners:(NSMutableArray<Mat*>*)corners ids:(Mat*)ids NS_SWIFT_NAME(detectMarkers(image:corners:ids:));
  110. //
  111. // void cv::aruco::ArucoDetector::refineDetectedMarkers(Mat image, Board board, vector_Mat& detectedCorners, Mat& detectedIds, vector_Mat& rejectedCorners, Mat cameraMatrix = Mat(), Mat distCoeffs = Mat(), Mat& recoveredIdxs = Mat())
  112. //
  113. /**
  114. * Refine not detected markers based on the already detected and the board layout
  115. *
  116. * @param image input image
  117. * @param board layout of markers in the board.
  118. * @param detectedCorners vector of already detected marker corners.
  119. * @param detectedIds vector of already detected marker identifiers.
  120. * @param rejectedCorners vector of rejected candidates during the marker detection process.
  121. * @param cameraMatrix optional input 3x3 floating-point camera matrix
  122. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$$`
  123. * @param distCoeffs optional vector of distortion coefficients
  124. * `$$(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
  125. * @param recoveredIdxs Optional array to returns the indexes of the recovered candidates in the
  126. * original rejectedCorners array.
  127. *
  128. * This function tries to find markers that were not detected in the basic detecMarkers function.
  129. * First, based on the current detected marker and the board layout, the function interpolates
  130. * the position of the missing markers. Then it tries to find correspondence between the reprojected
  131. * markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters.
  132. * If camera parameters and distortion coefficients are provided, missing markers are reprojected
  133. * using projectPoint function. If not, missing marker projections are interpolated using global
  134. * homography, and all the marker corners in the board must have the same Z coordinate.
  135. */
  136. - (void)refineDetectedMarkers:(Mat*)image board:(Board*)board detectedCorners:(NSMutableArray<Mat*>*)detectedCorners detectedIds:(Mat*)detectedIds rejectedCorners:(NSMutableArray<Mat*>*)rejectedCorners cameraMatrix:(Mat*)cameraMatrix distCoeffs:(Mat*)distCoeffs recoveredIdxs:(Mat*)recoveredIdxs NS_SWIFT_NAME(refineDetectedMarkers(image:board:detectedCorners:detectedIds:rejectedCorners:cameraMatrix:distCoeffs:recoveredIdxs:));
  137. /**
  138. * Refine not detected markers based on the already detected and the board layout
  139. *
  140. * @param image input image
  141. * @param board layout of markers in the board.
  142. * @param detectedCorners vector of already detected marker corners.
  143. * @param detectedIds vector of already detected marker identifiers.
  144. * @param rejectedCorners vector of rejected candidates during the marker detection process.
  145. * @param cameraMatrix optional input 3x3 floating-point camera matrix
  146. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$$`
  147. * @param distCoeffs optional vector of distortion coefficients
  148. * `$$(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
  149. * original rejectedCorners array.
  150. *
  151. * This function tries to find markers that were not detected in the basic detecMarkers function.
  152. * First, based on the current detected marker and the board layout, the function interpolates
  153. * the position of the missing markers. Then it tries to find correspondence between the reprojected
  154. * markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters.
  155. * If camera parameters and distortion coefficients are provided, missing markers are reprojected
  156. * using projectPoint function. If not, missing marker projections are interpolated using global
  157. * homography, and all the marker corners in the board must have the same Z coordinate.
  158. */
  159. - (void)refineDetectedMarkers:(Mat*)image board:(Board*)board detectedCorners:(NSMutableArray<Mat*>*)detectedCorners detectedIds:(Mat*)detectedIds rejectedCorners:(NSMutableArray<Mat*>*)rejectedCorners cameraMatrix:(Mat*)cameraMatrix distCoeffs:(Mat*)distCoeffs NS_SWIFT_NAME(refineDetectedMarkers(image:board:detectedCorners:detectedIds:rejectedCorners:cameraMatrix:distCoeffs:));
  160. /**
  161. * Refine not detected markers based on the already detected and the board layout
  162. *
  163. * @param image input image
  164. * @param board layout of markers in the board.
  165. * @param detectedCorners vector of already detected marker corners.
  166. * @param detectedIds vector of already detected marker identifiers.
  167. * @param rejectedCorners vector of rejected candidates during the marker detection process.
  168. * @param cameraMatrix optional input 3x3 floating-point camera matrix
  169. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$$`
  170. * `$$(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
  171. * original rejectedCorners array.
  172. *
  173. * This function tries to find markers that were not detected in the basic detecMarkers function.
  174. * First, based on the current detected marker and the board layout, the function interpolates
  175. * the position of the missing markers. Then it tries to find correspondence between the reprojected
  176. * markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters.
  177. * If camera parameters and distortion coefficients are provided, missing markers are reprojected
  178. * using projectPoint function. If not, missing marker projections are interpolated using global
  179. * homography, and all the marker corners in the board must have the same Z coordinate.
  180. */
  181. - (void)refineDetectedMarkers:(Mat*)image board:(Board*)board detectedCorners:(NSMutableArray<Mat*>*)detectedCorners detectedIds:(Mat*)detectedIds rejectedCorners:(NSMutableArray<Mat*>*)rejectedCorners cameraMatrix:(Mat*)cameraMatrix NS_SWIFT_NAME(refineDetectedMarkers(image:board:detectedCorners:detectedIds:rejectedCorners:cameraMatrix:));
  182. /**
  183. * Refine not detected markers based on the already detected and the board layout
  184. *
  185. * @param image input image
  186. * @param board layout of markers in the board.
  187. * @param detectedCorners vector of already detected marker corners.
  188. * @param detectedIds vector of already detected marker identifiers.
  189. * @param rejectedCorners vector of rejected candidates during the marker detection process.
  190. * `$$\newcommand{\vecthreethree}[9]{ \begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \end{bmatrix} } A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}$$`
  191. * `$$(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
  192. * original rejectedCorners array.
  193. *
  194. * This function tries to find markers that were not detected in the basic detecMarkers function.
  195. * First, based on the current detected marker and the board layout, the function interpolates
  196. * the position of the missing markers. Then it tries to find correspondence between the reprojected
  197. * markers and the rejected candidates based on the minRepDistance and errorCorrectionRate parameters.
  198. * If camera parameters and distortion coefficients are provided, missing markers are reprojected
  199. * using projectPoint function. If not, missing marker projections are interpolated using global
  200. * homography, and all the marker corners in the board must have the same Z coordinate.
  201. */
  202. - (void)refineDetectedMarkers:(Mat*)image board:(Board*)board detectedCorners:(NSMutableArray<Mat*>*)detectedCorners detectedIds:(Mat*)detectedIds rejectedCorners:(NSMutableArray<Mat*>*)rejectedCorners NS_SWIFT_NAME(refineDetectedMarkers(image:board:detectedCorners:detectedIds:rejectedCorners:));
  203. //
  204. // Dictionary cv::aruco::ArucoDetector::getDictionary()
  205. //
  206. - (Dictionary*)getDictionary NS_SWIFT_NAME(getDictionary());
  207. //
  208. // void cv::aruco::ArucoDetector::setDictionary(Dictionary dictionary)
  209. //
  210. - (void)setDictionary:(Dictionary*)dictionary NS_SWIFT_NAME(setDictionary(dictionary:));
  211. //
  212. // DetectorParameters cv::aruco::ArucoDetector::getDetectorParameters()
  213. //
  214. - (DetectorParameters*)getDetectorParameters NS_SWIFT_NAME(getDetectorParameters());
  215. //
  216. // void cv::aruco::ArucoDetector::setDetectorParameters(DetectorParameters detectorParameters)
  217. //
  218. - (void)setDetectorParameters:(DetectorParameters*)detectorParameters NS_SWIFT_NAME(setDetectorParameters(detectorParameters:));
  219. //
  220. // RefineParameters cv::aruco::ArucoDetector::getRefineParameters()
  221. //
  222. - (RefineParameters*)getRefineParameters NS_SWIFT_NAME(getRefineParameters());
  223. //
  224. // void cv::aruco::ArucoDetector::setRefineParameters(RefineParameters refineParameters)
  225. //
  226. - (void)setRefineParameters:(RefineParameters*)refineParameters NS_SWIFT_NAME(setRefineParameters(refineParameters:));
  227. //
  228. // void cv::aruco::ArucoDetector::write(FileStorage fs, String name)
  229. //
  230. // Unknown type 'FileStorage' (I), skipping the function
  231. //
  232. // void cv::aruco::ArucoDetector::read(FileNode fn)
  233. //
  234. // Unknown type 'FileNode' (I), skipping the function
  235. @end
  236. NS_ASSUME_NONNULL_END