test_aruco_utils.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #include "test_precomp.hpp"
  5. #include "opencv2/calib3d.hpp"
  6. namespace opencv_test {
  7. static inline double deg2rad(double deg) { return deg * CV_PI / 180.; }
  8. vector<Point2f> getAxis(InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _rvec, InputArray _tvec,
  9. float length, const Point2f offset = Point2f(0, 0));
  10. vector<Point2f> getMarkerById(int id, const vector<vector<Point2f> >& corners, const vector<int>& ids);
  11. /**
  12. * @brief Get rvec and tvec from yaw, pitch and distance
  13. */
  14. void getSyntheticRT(double yaw, double pitch, double distance, Mat& rvec, Mat& tvec);
  15. /**
  16. * @brief Project a synthetic marker
  17. */
  18. void projectMarker(Mat& img, const aruco::Board& board, int markerIndex, Mat cameraMatrix, Mat rvec, Mat tvec,
  19. int markerBorder);
  20. /**
  21. * @brief Get a synthetic image of GridBoard in perspective
  22. */
  23. Mat projectBoard(const aruco::GridBoard& board, Mat cameraMatrix, double yaw, double pitch, double distance,
  24. Size imageSize, int markerBorder);
  25. bool getCharucoBoardPose(InputArray charucoCorners, InputArray charucoIds, const aruco::CharucoBoard &board,
  26. InputArray cameraMatrix, InputArray distCoeffs, InputOutputArray rvec,
  27. InputOutputArray tvec, bool useExtrinsicGuess = false);
  28. void getMarkersPoses(InputArrayOfArrays corners, float markerLength, InputArray cameraMatrix, InputArray distCoeffs,
  29. OutputArray _rvecs, OutputArray _tvecs, OutputArray objPoints = noArray(),
  30. bool use_aruco_ccw_center = true, SolvePnPMethod solvePnPMethod = SolvePnPMethod::SOLVEPNP_ITERATIVE);
  31. }