CharucoBoard.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. #import "Board.h"
  14. @class Dictionary;
  15. @class Mat;
  16. @class Point3f;
  17. @class Size2i;
  18. NS_ASSUME_NONNULL_BEGIN
  19. // C++: class CharucoBoard
  20. /**
  21. * ChArUco board is a planar chessboard where the markers are placed inside the white squares of a chessboard.
  22. *
  23. * The benefits of ChArUco boards is that they provide both, ArUco markers versatility and chessboard corner precision,
  24. * which is important for calibration and pose estimation. The board image can be drawn using generateImage() method.
  25. *
  26. * Member of `Objdetect`
  27. */
  28. CV_EXPORTS @interface CharucoBoard : Board
  29. #ifdef __cplusplus
  30. @property(readonly)cv::Ptr<cv::aruco::CharucoBoard> nativePtrCharucoBoard;
  31. #endif
  32. #ifdef __cplusplus
  33. - (instancetype)initWithNativePtr:(cv::Ptr<cv::aruco::CharucoBoard>)nativePtr;
  34. + (instancetype)fromNative:(cv::Ptr<cv::aruco::CharucoBoard>)nativePtr;
  35. #endif
  36. #pragma mark - Methods
  37. //
  38. // cv::aruco::CharucoBoard::CharucoBoard(Size size, float squareLength, float markerLength, Dictionary dictionary, Mat ids = Mat())
  39. //
  40. /**
  41. * CharucoBoard constructor
  42. *
  43. * @param size number of chessboard squares in x and y directions
  44. * @param squareLength squareLength chessboard square side length (normally in meters)
  45. * @param markerLength marker side length (same unit than squareLength)
  46. * @param dictionary dictionary of markers indicating the type of markers
  47. * @param ids array of id used markers
  48. * The first markers in the dictionary are used to fill the white chessboard squares.
  49. */
  50. - (instancetype)initWithSize:(Size2i*)size squareLength:(float)squareLength markerLength:(float)markerLength dictionary:(Dictionary*)dictionary ids:(Mat*)ids;
  51. /**
  52. * CharucoBoard constructor
  53. *
  54. * @param size number of chessboard squares in x and y directions
  55. * @param squareLength squareLength chessboard square side length (normally in meters)
  56. * @param markerLength marker side length (same unit than squareLength)
  57. * @param dictionary dictionary of markers indicating the type of markers
  58. * The first markers in the dictionary are used to fill the white chessboard squares.
  59. */
  60. - (instancetype)initWithSize:(Size2i*)size squareLength:(float)squareLength markerLength:(float)markerLength dictionary:(Dictionary*)dictionary;
  61. //
  62. // void cv::aruco::CharucoBoard::setLegacyPattern(bool legacyPattern)
  63. //
  64. /**
  65. * set legacy chessboard pattern.
  66. *
  67. * Legacy setting creates chessboard patterns starting with a white box in the upper left corner
  68. * if there is an even row count of chessboard boxes, otherwise it starts with a black box.
  69. * This setting ensures compatibility to patterns created with OpenCV versions prior OpenCV 4.6.0.
  70. * See https://github.com/opencv/opencv/issues/23152.
  71. *
  72. * Default value: false.
  73. */
  74. - (void)setLegacyPattern:(BOOL)legacyPattern NS_SWIFT_NAME(setLegacyPattern(legacyPattern:));
  75. //
  76. // bool cv::aruco::CharucoBoard::getLegacyPattern()
  77. //
  78. - (BOOL)getLegacyPattern NS_SWIFT_NAME(getLegacyPattern());
  79. //
  80. // Size cv::aruco::CharucoBoard::getChessboardSize()
  81. //
  82. - (Size2i*)getChessboardSize NS_SWIFT_NAME(getChessboardSize());
  83. //
  84. // float cv::aruco::CharucoBoard::getSquareLength()
  85. //
  86. - (float)getSquareLength NS_SWIFT_NAME(getSquareLength());
  87. //
  88. // float cv::aruco::CharucoBoard::getMarkerLength()
  89. //
  90. - (float)getMarkerLength NS_SWIFT_NAME(getMarkerLength());
  91. //
  92. // vector_Point3f cv::aruco::CharucoBoard::getChessboardCorners()
  93. //
  94. /**
  95. * get CharucoBoard::chessboardCorners
  96. */
  97. - (NSArray<Point3f*>*)getChessboardCorners NS_SWIFT_NAME(getChessboardCorners());
  98. //
  99. // bool cv::aruco::CharucoBoard::checkCharucoCornersCollinear(Mat charucoIds)
  100. //
  101. /**
  102. * check whether the ChArUco markers are collinear
  103. *
  104. * @param charucoIds list of identifiers for each corner in charucoCorners per frame.
  105. * @return bool value, 1 (true) if detected corners form a line, 0 (false) if they do not.
  106. * solvePnP, calibration functions will fail if the corners are collinear (true).
  107. *
  108. * The number of ids in charucoIDs should be <= the number of chessboard corners in the board.
  109. * This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false).
  110. * Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases:
  111. * for number of charucoIDs <= 2,the function returns true.
  112. */
  113. - (BOOL)checkCharucoCornersCollinear:(Mat*)charucoIds NS_SWIFT_NAME(checkCharucoCornersCollinear(charucoIds:));
  114. @end
  115. NS_ASSUME_NONNULL_END