Board.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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_board.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. @class Dictionary;
  14. @class IntVector;
  15. @class Mat;
  16. @class Point3f;
  17. @class Size2i;
  18. NS_ASSUME_NONNULL_BEGIN
  19. // C++: class Board
  20. /**
  21. * Board of ArUco markers
  22. *
  23. * A board is a set of markers in the 3D space with a common coordinate system.
  24. * The common form of a board of marker is a planar (2D) board, however any 3D layout can be used.
  25. * A Board object is composed by:
  26. * - The object points of the marker corners, i.e. their coordinates respect to the board system.
  27. * - The dictionary which indicates the type of markers of the board
  28. * - The identifier of all the markers in the board.
  29. *
  30. * Member of `Objdetect`
  31. */
  32. CV_EXPORTS @interface Board : NSObject
  33. #ifdef __cplusplus
  34. @property(readonly)cv::Ptr<cv::aruco::Board> nativePtr;
  35. #endif
  36. #ifdef __cplusplus
  37. - (instancetype)initWithNativePtr:(cv::Ptr<cv::aruco::Board>)nativePtr;
  38. + (instancetype)fromNative:(cv::Ptr<cv::aruco::Board>)nativePtr;
  39. #endif
  40. #pragma mark - Methods
  41. //
  42. // cv::aruco::Board::Board(vector_Mat objPoints, Dictionary dictionary, Mat ids)
  43. //
  44. /**
  45. * Common Board constructor
  46. *
  47. * @param objPoints array of object points of all the marker corners in the board
  48. * @param dictionary the dictionary of markers employed for this board
  49. * @param ids vector of the identifiers of the markers in the board
  50. */
  51. - (instancetype)initWithObjPoints:(NSArray<Mat*>*)objPoints dictionary:(Dictionary*)dictionary ids:(Mat*)ids;
  52. //
  53. // Dictionary cv::aruco::Board::getDictionary()
  54. //
  55. /**
  56. * return the Dictionary of markers employed for this board
  57. */
  58. - (Dictionary*)getDictionary NS_SWIFT_NAME(getDictionary());
  59. //
  60. // vector_vector_Point3f cv::aruco::Board::getObjPoints()
  61. //
  62. /**
  63. * return array of object points of all the marker corners in the board.
  64. *
  65. * Each marker include its 4 corners in this order:
  66. * - objPoints[i][0] - left-top point of i-th marker
  67. * - objPoints[i][1] - right-top point of i-th marker
  68. * - objPoints[i][2] - right-bottom point of i-th marker
  69. * - objPoints[i][3] - left-bottom point of i-th marker
  70. *
  71. * Markers are placed in a certain order - row by row, left to right in every row. For M markers, the size is Mx4.
  72. */
  73. - (NSArray<NSArray<Point3f*>*>*)getObjPoints NS_SWIFT_NAME(getObjPoints());
  74. //
  75. // vector_int cv::aruco::Board::getIds()
  76. //
  77. /**
  78. * vector of the identifiers of the markers in the board (should be the same size as objPoints)
  79. * @return vector of the identifiers of the markers
  80. */
  81. - (IntVector*)getIds NS_SWIFT_NAME(getIds());
  82. //
  83. // Point3f cv::aruco::Board::getRightBottomCorner()
  84. //
  85. /**
  86. * get coordinate of the bottom right corner of the board, is set when calling the function create()
  87. */
  88. - (Point3f*)getRightBottomCorner NS_SWIFT_NAME(getRightBottomCorner());
  89. //
  90. // void cv::aruco::Board::matchImagePoints(vector_Mat detectedCorners, Mat detectedIds, Mat& objPoints, Mat& imgPoints)
  91. //
  92. /**
  93. * Given a board configuration and a set of detected markers, returns the corresponding
  94. * image points and object points, can be used in solvePnP()
  95. *
  96. * @param detectedCorners List of detected marker corners of the board.
  97. * For cv::Board and cv::GridBoard the method expects std::vector<std::vector<Point2f>> or std::vector<Mat> with Aruco marker corners.
  98. * For cv::CharucoBoard the method expects std::vector<Point2f> or Mat with ChAruco corners (chess board corners matched with Aruco markers).
  99. *
  100. * @param detectedIds List of identifiers for each marker or charuco corner.
  101. * For any Board class the method expects std::vector<int> or Mat.
  102. *
  103. * @param objPoints Vector of marker points in the board coordinate space.
  104. * For any Board class the method expects std::vector<cv::Point3f> objectPoints or cv::Mat
  105. *
  106. * @param imgPoints Vector of marker points in the image coordinate space.
  107. * For any Board class the method expects std::vector<cv::Point2f> objectPoints or cv::Mat
  108. *
  109. * @see `solvePnP`
  110. */
  111. - (void)matchImagePoints:(NSArray<Mat*>*)detectedCorners detectedIds:(Mat*)detectedIds objPoints:(Mat*)objPoints imgPoints:(Mat*)imgPoints NS_SWIFT_NAME(matchImagePoints(detectedCorners:detectedIds:objPoints:imgPoints:));
  112. //
  113. // void cv::aruco::Board::generateImage(Size outSize, Mat& img, int marginSize = 0, int borderBits = 1)
  114. //
  115. /**
  116. * Draw a planar board
  117. *
  118. * @param outSize size of the output image in pixels.
  119. * @param img output image with the board. The size of this image will be outSize
  120. * and the board will be on the center, keeping the board proportions.
  121. * @param marginSize minimum margins (in pixels) of the board in the output image
  122. * @param borderBits width of the marker borders.
  123. *
  124. * This function return the image of the board, ready to be printed.
  125. */
  126. - (void)generateImage:(Size2i*)outSize img:(Mat*)img marginSize:(int)marginSize borderBits:(int)borderBits NS_SWIFT_NAME(generateImage(outSize:img:marginSize:borderBits:));
  127. /**
  128. * Draw a planar board
  129. *
  130. * @param outSize size of the output image in pixels.
  131. * @param img output image with the board. The size of this image will be outSize
  132. * and the board will be on the center, keeping the board proportions.
  133. * @param marginSize minimum margins (in pixels) of the board in the output image
  134. *
  135. * This function return the image of the board, ready to be printed.
  136. */
  137. - (void)generateImage:(Size2i*)outSize img:(Mat*)img marginSize:(int)marginSize NS_SWIFT_NAME(generateImage(outSize:img:marginSize:));
  138. /**
  139. * Draw a planar board
  140. *
  141. * @param outSize size of the output image in pixels.
  142. * @param img output image with the board. The size of this image will be outSize
  143. * and the board will be on the center, keeping the board proportions.
  144. *
  145. * This function return the image of the board, ready to be printed.
  146. */
  147. - (void)generateImage:(Size2i*)outSize img:(Mat*)img NS_SWIFT_NAME(generateImage(outSize:img:));
  148. @end
  149. NS_ASSUME_NONNULL_END