Objdetect.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. @class Dictionary;
  13. @class IntVector;
  14. @class Mat;
  15. @class Rect2i;
  16. @class Scalar;
  17. // C++: enum ObjectStatus (cv.DetectionBasedTracker.ObjectStatus)
  18. typedef NS_ENUM(int, ObjectStatus) {
  19. DetectionBasedTracker_DETECTED_NOT_SHOWN_YET NS_SWIFT_NAME(DETECTED_NOT_SHOWN_YET) = 0,
  20. DetectionBasedTracker_DETECTED NS_SWIFT_NAME(DETECTED) = 1,
  21. DetectionBasedTracker_DETECTED_TEMPORARY_LOST NS_SWIFT_NAME(DETECTED_TEMPORARY_LOST) = 2,
  22. DetectionBasedTracker_WRONG_OBJECT NS_SWIFT_NAME(WRONG_OBJECT) = 3
  23. };
  24. // C++: enum CornerRefineMethod (cv.aruco.CornerRefineMethod)
  25. typedef NS_ENUM(int, CornerRefineMethod) {
  26. CORNER_REFINE_NONE = 0,
  27. CORNER_REFINE_SUBPIX = 1,
  28. CORNER_REFINE_CONTOUR = 2,
  29. CORNER_REFINE_APRILTAG = 3
  30. };
  31. // C++: enum PredefinedDictionaryType (cv.aruco.PredefinedDictionaryType)
  32. typedef NS_ENUM(int, PredefinedDictionaryType) {
  33. DICT_4X4_50 = 0,
  34. DICT_4X4_100 = 0+1,
  35. DICT_4X4_250 = 0+2,
  36. DICT_4X4_1000 = 0+3,
  37. DICT_5X5_50 = 0+4,
  38. DICT_5X5_100 = 0+5,
  39. DICT_5X5_250 = 0+6,
  40. DICT_5X5_1000 = 0+7,
  41. DICT_6X6_50 = 0+8,
  42. DICT_6X6_100 = 0+9,
  43. DICT_6X6_250 = 0+10,
  44. DICT_6X6_1000 = 0+11,
  45. DICT_7X7_50 = 0+12,
  46. DICT_7X7_100 = 0+13,
  47. DICT_7X7_250 = 0+14,
  48. DICT_7X7_1000 = 0+15,
  49. DICT_ARUCO_ORIGINAL = 0+16,
  50. DICT_APRILTAG_16h5 = 0+17,
  51. DICT_APRILTAG_25h9 = 0+18,
  52. DICT_APRILTAG_36h10 = 0+19,
  53. DICT_APRILTAG_36h11 = 0+20,
  54. DICT_ARUCO_MIP_36h12 = 0+21
  55. };
  56. NS_ASSUME_NONNULL_BEGIN
  57. // C++: class Objdetect
  58. /**
  59. * The Objdetect module
  60. *
  61. * Member classes: `BaseCascadeClassifier`, `CascadeClassifier`, `HOGDescriptor`, `QRCodeEncoder`, `QRCodeEncoderParams`, `QRCodeDetector`, `QRCodeDetectorAruco`, `QRCodeDetectorArucoParams`, `Board`, `GridBoard`, `CharucoBoard`, `DetectorParameters`, `RefineParameters`, `ArucoDetector`, `Dictionary`, `GraphicalCodeDetector`, `FaceDetectorYN`, `FaceRecognizerSF`, `CharucoParameters`, `CharucoDetector`, `BarcodeDetector`
  62. *
  63. * Member enums: `HistogramNormType`, `DescriptorStorageFormat`, `EncodeMode`, `CorrectionLevel`, `ECIEncodings`, `CornerRefineMethod`, `PredefinedDictionaryType`, `ObjectStatus`, `DisType`
  64. */
  65. CV_EXPORTS @interface Objdetect : NSObject
  66. #pragma mark - Class Constants
  67. @property (class, readonly) int CASCADE_DO_CANNY_PRUNING NS_SWIFT_NAME(CASCADE_DO_CANNY_PRUNING);
  68. @property (class, readonly) int CASCADE_SCALE_IMAGE NS_SWIFT_NAME(CASCADE_SCALE_IMAGE);
  69. @property (class, readonly) int CASCADE_FIND_BIGGEST_OBJECT NS_SWIFT_NAME(CASCADE_FIND_BIGGEST_OBJECT);
  70. @property (class, readonly) int CASCADE_DO_ROUGH_SEARCH NS_SWIFT_NAME(CASCADE_DO_ROUGH_SEARCH);
  71. #pragma mark - Methods
  72. //
  73. // void cv::groupRectangles(vector_Rect& rectList, vector_int& weights, int groupThreshold, double eps = 0.2)
  74. //
  75. + (void)groupRectangles:(NSMutableArray<Rect2i*>*)rectList weights:(IntVector*)weights groupThreshold:(int)groupThreshold eps:(double)eps NS_SWIFT_NAME(groupRectangles(rectList:weights:groupThreshold:eps:));
  76. + (void)groupRectangles:(NSMutableArray<Rect2i*>*)rectList weights:(IntVector*)weights groupThreshold:(int)groupThreshold NS_SWIFT_NAME(groupRectangles(rectList:weights:groupThreshold:));
  77. //
  78. // void cv::aruco::drawDetectedMarkers(Mat& image, vector_Mat corners, Mat ids = Mat(), Scalar borderColor = Scalar(0, 255, 0))
  79. //
  80. /**
  81. * Draw detected markers in image
  82. *
  83. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  84. * @param corners positions of marker corners on input image.
  85. * (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of
  86. * this array should be Nx4. The order of the corners should be clockwise.
  87. * @param ids vector of identifiers for markers in markersCorners .
  88. * Optional, if not provided, ids are not painted.
  89. * @param borderColor color of marker borders. Rest of colors (text color and first corner color)
  90. * are calculated based on this one to improve visualization.
  91. *
  92. * Given an array of detected marker corners and its corresponding ids, this functions draws
  93. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  94. * Useful for debugging purposes.
  95. */
  96. + (void)drawDetectedMarkers:(Mat*)image corners:(NSArray<Mat*>*)corners ids:(Mat*)ids borderColor:(Scalar*)borderColor NS_SWIFT_NAME(drawDetectedMarkers(image:corners:ids:borderColor:));
  97. /**
  98. * Draw detected markers in image
  99. *
  100. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  101. * @param corners positions of marker corners on input image.
  102. * (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of
  103. * this array should be Nx4. The order of the corners should be clockwise.
  104. * @param ids vector of identifiers for markers in markersCorners .
  105. * Optional, if not provided, ids are not painted.
  106. * are calculated based on this one to improve visualization.
  107. *
  108. * Given an array of detected marker corners and its corresponding ids, this functions draws
  109. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  110. * Useful for debugging purposes.
  111. */
  112. + (void)drawDetectedMarkers:(Mat*)image corners:(NSArray<Mat*>*)corners ids:(Mat*)ids NS_SWIFT_NAME(drawDetectedMarkers(image:corners:ids:));
  113. /**
  114. * Draw detected markers in image
  115. *
  116. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not altered.
  117. * @param corners positions of marker corners on input image.
  118. * (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers, the dimensions of
  119. * this array should be Nx4. The order of the corners should be clockwise.
  120. * Optional, if not provided, ids are not painted.
  121. * are calculated based on this one to improve visualization.
  122. *
  123. * Given an array of detected marker corners and its corresponding ids, this functions draws
  124. * the markers in the image. The marker borders are painted and the markers identifiers if provided.
  125. * Useful for debugging purposes.
  126. */
  127. + (void)drawDetectedMarkers:(Mat*)image corners:(NSArray<Mat*>*)corners NS_SWIFT_NAME(drawDetectedMarkers(image:corners:));
  128. //
  129. // void cv::aruco::generateImageMarker(Dictionary dictionary, int id, int sidePixels, Mat& img, int borderBits = 1)
  130. //
  131. /**
  132. * Generate a canonical marker image
  133. *
  134. * @param dictionary dictionary of markers indicating the type of markers
  135. * @param id identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
  136. * @param sidePixels size of the image in pixels
  137. * @param img output image with the marker
  138. * @param borderBits width of the marker border.
  139. *
  140. * This function returns a marker image in its canonical form (i.e. ready to be printed)
  141. */
  142. + (void)generateImageMarker:(Dictionary*)dictionary id:(int)id sidePixels:(int)sidePixels img:(Mat*)img borderBits:(int)borderBits NS_SWIFT_NAME(generateImageMarker(dictionary:id:sidePixels:img:borderBits:));
  143. /**
  144. * Generate a canonical marker image
  145. *
  146. * @param dictionary dictionary of markers indicating the type of markers
  147. * @param id identifier of the marker that will be returned. It has to be a valid id in the specified dictionary.
  148. * @param sidePixels size of the image in pixels
  149. * @param img output image with the marker
  150. *
  151. * This function returns a marker image in its canonical form (i.e. ready to be printed)
  152. */
  153. + (void)generateImageMarker:(Dictionary*)dictionary id:(int)id sidePixels:(int)sidePixels img:(Mat*)img NS_SWIFT_NAME(generateImageMarker(dictionary:id:sidePixels:img:));
  154. //
  155. // Dictionary cv::aruco::getPredefinedDictionary(int dict)
  156. //
  157. /**
  158. * Returns one of the predefined dictionaries referenced by DICT_*.
  159. */
  160. + (Dictionary*)getPredefinedDictionary:(int)dict NS_SWIFT_NAME(getPredefinedDictionary(dict:));
  161. //
  162. // Dictionary cv::aruco::extendDictionary(int nMarkers, int markerSize, Dictionary baseDictionary = Dictionary(), int randomSeed = 0)
  163. //
  164. /**
  165. * Extend base dictionary by new nMarkers
  166. *
  167. * @param nMarkers number of markers in the dictionary
  168. * @param markerSize number of bits per dimension of each markers
  169. * @param baseDictionary Include the markers in this dictionary at the beginning (optional)
  170. * @param randomSeed a user supplied seed for theRNG()
  171. *
  172. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  173. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  174. * included and the rest are generated based on them. If the size of baseDictionary is higher
  175. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  176. */
  177. + (Dictionary*)extendDictionary:(int)nMarkers markerSize:(int)markerSize baseDictionary:(Dictionary*)baseDictionary randomSeed:(int)randomSeed NS_SWIFT_NAME(extendDictionary(nMarkers:markerSize:baseDictionary:randomSeed:));
  178. /**
  179. * Extend base dictionary by new nMarkers
  180. *
  181. * @param nMarkers number of markers in the dictionary
  182. * @param markerSize number of bits per dimension of each markers
  183. * @param baseDictionary Include the markers in this dictionary at the beginning (optional)
  184. *
  185. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  186. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  187. * included and the rest are generated based on them. If the size of baseDictionary is higher
  188. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  189. */
  190. + (Dictionary*)extendDictionary:(int)nMarkers markerSize:(int)markerSize baseDictionary:(Dictionary*)baseDictionary NS_SWIFT_NAME(extendDictionary(nMarkers:markerSize:baseDictionary:));
  191. /**
  192. * Extend base dictionary by new nMarkers
  193. *
  194. * @param nMarkers number of markers in the dictionary
  195. * @param markerSize number of bits per dimension of each markers
  196. *
  197. * This function creates a new dictionary composed by nMarkers markers and each markers composed
  198. * by markerSize x markerSize bits. If baseDictionary is provided, its markers are directly
  199. * included and the rest are generated based on them. If the size of baseDictionary is higher
  200. * than nMarkers, only the first nMarkers in baseDictionary are taken and no new marker is added.
  201. */
  202. + (Dictionary*)extendDictionary:(int)nMarkers markerSize:(int)markerSize NS_SWIFT_NAME(extendDictionary(nMarkers:markerSize:));
  203. //
  204. // void cv::aruco::drawDetectedCornersCharuco(Mat& image, Mat charucoCorners, Mat charucoIds = Mat(), Scalar cornerColor = Scalar(255, 0, 0))
  205. //
  206. /**
  207. * Draws a set of Charuco corners
  208. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  209. * altered.
  210. * @param charucoCorners vector of detected charuco corners
  211. * @param charucoIds list of identifiers for each corner in charucoCorners
  212. * @param cornerColor color of the square surrounding each corner
  213. *
  214. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  215. * draws the id of each corner.
  216. */
  217. + (void)drawDetectedCornersCharuco:(Mat*)image charucoCorners:(Mat*)charucoCorners charucoIds:(Mat*)charucoIds cornerColor:(Scalar*)cornerColor NS_SWIFT_NAME(drawDetectedCornersCharuco(image:charucoCorners:charucoIds:cornerColor:));
  218. /**
  219. * Draws a set of Charuco corners
  220. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  221. * altered.
  222. * @param charucoCorners vector of detected charuco corners
  223. * @param charucoIds list of identifiers for each corner in charucoCorners
  224. *
  225. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  226. * draws the id of each corner.
  227. */
  228. + (void)drawDetectedCornersCharuco:(Mat*)image charucoCorners:(Mat*)charucoCorners charucoIds:(Mat*)charucoIds NS_SWIFT_NAME(drawDetectedCornersCharuco(image:charucoCorners:charucoIds:));
  229. /**
  230. * Draws a set of Charuco corners
  231. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  232. * altered.
  233. * @param charucoCorners vector of detected charuco corners
  234. *
  235. * This function draws a set of detected Charuco corners. If identifiers vector is provided, it also
  236. * draws the id of each corner.
  237. */
  238. + (void)drawDetectedCornersCharuco:(Mat*)image charucoCorners:(Mat*)charucoCorners NS_SWIFT_NAME(drawDetectedCornersCharuco(image:charucoCorners:));
  239. //
  240. // void cv::aruco::drawDetectedDiamonds(Mat& image, vector_Mat diamondCorners, Mat diamondIds = Mat(), Scalar borderColor = Scalar(0, 0, 255))
  241. //
  242. /**
  243. * Draw a set of detected ChArUco Diamond markers
  244. *
  245. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  246. * altered.
  247. * @param diamondCorners positions of diamond corners in the same format returned by
  248. * detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers,
  249. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  250. * @param diamondIds vector of identifiers for diamonds in diamondCorners, in the same format
  251. * returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>).
  252. * Optional, if not provided, ids are not painted.
  253. * @param borderColor color of marker borders. Rest of colors (text color and first corner color)
  254. * are calculated based on this one.
  255. *
  256. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  257. * are painted and the markers identifiers if provided.
  258. * Useful for debugging purposes.
  259. */
  260. + (void)drawDetectedDiamonds:(Mat*)image diamondCorners:(NSArray<Mat*>*)diamondCorners diamondIds:(Mat*)diamondIds borderColor:(Scalar*)borderColor NS_SWIFT_NAME(drawDetectedDiamonds(image:diamondCorners:diamondIds:borderColor:));
  261. /**
  262. * Draw a set of detected ChArUco Diamond markers
  263. *
  264. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  265. * altered.
  266. * @param diamondCorners positions of diamond corners in the same format returned by
  267. * detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers,
  268. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  269. * @param diamondIds vector of identifiers for diamonds in diamondCorners, in the same format
  270. * returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>).
  271. * Optional, if not provided, ids are not painted.
  272. * are calculated based on this one.
  273. *
  274. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  275. * are painted and the markers identifiers if provided.
  276. * Useful for debugging purposes.
  277. */
  278. + (void)drawDetectedDiamonds:(Mat*)image diamondCorners:(NSArray<Mat*>*)diamondCorners diamondIds:(Mat*)diamondIds NS_SWIFT_NAME(drawDetectedDiamonds(image:diamondCorners:diamondIds:));
  279. /**
  280. * Draw a set of detected ChArUco Diamond markers
  281. *
  282. * @param image input/output image. It must have 1 or 3 channels. The number of channels is not
  283. * altered.
  284. * @param diamondCorners positions of diamond corners in the same format returned by
  285. * detectCharucoDiamond(). (e.g std::vector<std::vector<cv::Point2f> > ). For N detected markers,
  286. * the dimensions of this array should be Nx4. The order of the corners should be clockwise.
  287. * returned by detectCharucoDiamond() (e.g. std::vector<Vec4i>).
  288. * Optional, if not provided, ids are not painted.
  289. * are calculated based on this one.
  290. *
  291. * Given an array of detected diamonds, this functions draws them in the image. The marker borders
  292. * are painted and the markers identifiers if provided.
  293. * Useful for debugging purposes.
  294. */
  295. + (void)drawDetectedDiamonds:(Mat*)image diamondCorners:(NSArray<Mat*>*)diamondCorners NS_SWIFT_NAME(drawDetectedDiamonds(image:diamondCorners:));
  296. @end
  297. NS_ASSUME_NONNULL_END