aruco.hpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html
  4. #ifndef OPENCV_ARUCO_HPP
  5. #define OPENCV_ARUCO_HPP
  6. #include "opencv2/objdetect/aruco_detector.hpp"
  7. #include "opencv2/aruco/aruco_calib.hpp"
  8. namespace cv {
  9. namespace aruco {
  10. /**
  11. * @defgroup aruco Aruco markers, module functionality was moved to objdetect module
  12. * @{
  13. * ArUco Marker Detection, module functionality was moved to objdetect module
  14. * @sa ArucoDetector, CharucoDetector, Board, GridBoard, CharucoBoard
  15. * @}
  16. */
  17. //! @addtogroup aruco
  18. //! @{
  19. /** @brief detect markers
  20. @deprecated Use class ArucoDetector::detectMarkers
  21. */
  22. CV_EXPORTS_W void detectMarkers(InputArray image, const Ptr<Dictionary> &dictionary, OutputArrayOfArrays corners,
  23. OutputArray ids, const Ptr<DetectorParameters> &parameters = makePtr<DetectorParameters>(),
  24. OutputArrayOfArrays rejectedImgPoints = noArray());
  25. /** @brief refine detected markers
  26. @deprecated Use class ArucoDetector::refineDetectedMarkers
  27. */
  28. CV_EXPORTS_W void refineDetectedMarkers(InputArray image,const Ptr<Board> &board,
  29. InputOutputArrayOfArrays detectedCorners,
  30. InputOutputArray detectedIds, InputOutputArrayOfArrays rejectedCorners,
  31. InputArray cameraMatrix = noArray(), InputArray distCoeffs = noArray(),
  32. float minRepDistance = 10.f, float errorCorrectionRate = 3.f,
  33. bool checkAllOrders = true, OutputArray recoveredIdxs = noArray(),
  34. const Ptr<DetectorParameters> &parameters = makePtr<DetectorParameters>());
  35. /** @brief draw planar board
  36. @deprecated Use Board::generateImage
  37. */
  38. CV_EXPORTS_W void drawPlanarBoard(const Ptr<Board> &board, Size outSize, OutputArray img, int marginSize,
  39. int borderBits);
  40. /** @brief get board object and image points
  41. @deprecated Use Board::matchImagePoints
  42. */
  43. CV_EXPORTS_W void getBoardObjectAndImagePoints(const Ptr<Board> &board, InputArrayOfArrays detectedCorners,
  44. InputArray detectedIds, OutputArray objPoints, OutputArray imgPoints);
  45. /** @deprecated Use cv::solvePnP
  46. */
  47. CV_EXPORTS_W int estimatePoseBoard(InputArrayOfArrays corners, InputArray ids, const Ptr<Board> &board,
  48. InputArray cameraMatrix, InputArray distCoeffs, InputOutputArray rvec,
  49. InputOutputArray tvec, bool useExtrinsicGuess = false);
  50. /**
  51. * @brief Pose estimation for a ChArUco board given some of their corners
  52. * @param charucoCorners vector of detected charuco corners
  53. * @param charucoIds list of identifiers for each corner in charucoCorners
  54. * @param board layout of ChArUco board.
  55. * @param cameraMatrix input 3x3 floating-point camera matrix
  56. * \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$
  57. * @param distCoeffs vector of distortion coefficients
  58. * \f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\f$ of 4, 5, 8 or 12 elements
  59. * @param rvec Output vector (e.g. cv::Mat) corresponding to the rotation vector of the board
  60. * (see cv::Rodrigues).
  61. * @param tvec Output vector (e.g. cv::Mat) corresponding to the translation vector of the board.
  62. * @param useExtrinsicGuess defines whether initial guess for \b rvec and \b tvec will be used or not.
  63. *
  64. * This function estimates a Charuco board pose from some detected corners.
  65. * The function checks if the input corners are enough and valid to perform pose estimation.
  66. * If pose estimation is valid, returns true, else returns false.
  67. * @sa use cv::drawFrameAxes to get world coordinate system axis for object points
  68. */
  69. CV_EXPORTS_W bool estimatePoseCharucoBoard(InputArray charucoCorners, InputArray charucoIds,
  70. const Ptr<CharucoBoard> &board, InputArray cameraMatrix,
  71. InputArray distCoeffs, InputOutputArray rvec,
  72. InputOutputArray tvec, bool useExtrinsicGuess = false);
  73. /** @deprecated Use cv::solvePnP
  74. */
  75. CV_EXPORTS_W void estimatePoseSingleMarkers(InputArrayOfArrays corners, float markerLength,
  76. InputArray cameraMatrix, InputArray distCoeffs,
  77. OutputArray rvecs, OutputArray tvecs, OutputArray objPoints = noArray(),
  78. const Ptr<EstimateParameters>& estimateParameters = makePtr<EstimateParameters>());
  79. /** @deprecated Use CharucoBoard::checkCharucoCornersCollinear
  80. */
  81. CV_EXPORTS_W bool testCharucoCornersCollinear(const Ptr<CharucoBoard> &board, InputArray charucoIds);
  82. //! @}
  83. }
  84. }
  85. #endif