|
| 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_CALIB_POSE_HPP__ |
| 5 | +#define __OPENCV_ARUCO_CALIB_POSE_HPP__ |
| 6 | +#include <opencv2/objdetect/aruco_board.hpp> |
| 7 | + |
| 8 | +namespace cv { |
| 9 | +namespace aruco { |
| 10 | + |
| 11 | +//! @addtogroup aruco |
| 12 | +//! @{ |
| 13 | + |
| 14 | +/** |
| 15 | + * @brief Calibrate a camera using aruco markers |
| 16 | + * |
| 17 | + * @param corners vector of detected marker corners in all frames. |
| 18 | + * The corners should have the same format returned by detectMarkers (see #detectMarkers). |
| 19 | + * @param ids list of identifiers for each marker in corners |
| 20 | + * @param counter number of markers in each frame so that corners and ids can be split |
| 21 | + * @param board Marker Board layout |
| 22 | + * @param imageSize Size of the image used only to initialize the intrinsic camera matrix. |
| 23 | + * @param cameraMatrix Output 3x3 floating-point camera matrix |
| 24 | + * \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If CV\_CALIB\_USE\_INTRINSIC\_GUESS |
| 25 | + * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be |
| 26 | + * initialized before calling the function. |
| 27 | + * @param distCoeffs Output vector of distortion coefficients |
| 28 | + * \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 |
| 29 | + * @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view |
| 30 | + * (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding |
| 31 | + * k-th translation vector (see the next output parameter description) brings the board pattern |
| 32 | + * from the model coordinate space (in which object points are specified) to the world coordinate |
| 33 | + * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1). |
| 34 | + * @param tvecs Output vector of translation vectors estimated for each pattern view. |
| 35 | + * @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters. |
| 36 | + * Order of deviations values: |
| 37 | + * \f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, |
| 38 | + * s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero. |
| 39 | + * @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters. |
| 40 | + * Order of deviations values: \f$(R_1, T_1, \dotsc , R_M, T_M)\f$ where M is number of pattern views, |
| 41 | + * \f$R_i, T_i\f$ are concatenated 1x3 vectors. |
| 42 | + * @param perViewErrors Output vector of average re-projection errors estimated for each pattern view. |
| 43 | + * @param flags flags Different flags for the calibration process (see #calibrateCamera for details). |
| 44 | + * @param criteria Termination criteria for the iterative optimization algorithm. |
| 45 | + * |
| 46 | + * This function calibrates a camera using an Aruco Board. The function receives a list of |
| 47 | + * detected markers from several views of the Board. The process is similar to the chessboard |
| 48 | + * calibration in calibrateCamera(). The function returns the final re-projection error. |
| 49 | + */ |
| 50 | +CV_EXPORTS_AS(calibrateCameraArucoExtended) |
| 51 | +double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArray counter, const Ptr<Board> &board, |
| 52 | + Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs, |
| 53 | + OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, OutputArray stdDeviationsIntrinsics, |
| 54 | + OutputArray stdDeviationsExtrinsics, OutputArray perViewErrors, int flags = 0, |
| 55 | + const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)); |
| 56 | + |
| 57 | +/** @overload |
| 58 | + * @brief It's the same function as #calibrateCameraAruco but without calibration error estimation. |
| 59 | + */ |
| 60 | +CV_EXPORTS_W double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArray counter, |
| 61 | + const Ptr<Board> &board, Size imageSize, InputOutputArray cameraMatrix, |
| 62 | + InputOutputArray distCoeffs, OutputArrayOfArrays rvecs = noArray(), |
| 63 | + OutputArrayOfArrays tvecs = noArray(), int flags = 0, |
| 64 | + const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, |
| 65 | + 30, DBL_EPSILON)); |
| 66 | + |
| 67 | + |
| 68 | +/** |
| 69 | + * @brief Calibrate a camera using Charuco corners |
| 70 | + * |
| 71 | + * @param charucoCorners vector of detected charuco corners per frame |
| 72 | + * @param charucoIds list of identifiers for each corner in charucoCorners per frame |
| 73 | + * @param board Marker Board layout |
| 74 | + * @param imageSize input image size |
| 75 | + * @param cameraMatrix Output 3x3 floating-point camera matrix |
| 76 | + * \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If CV\_CALIB\_USE\_INTRINSIC\_GUESS |
| 77 | + * and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be |
| 78 | + * initialized before calling the function. |
| 79 | + * @param distCoeffs Output vector of distortion coefficients |
| 80 | + * \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 |
| 81 | + * @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each board view |
| 82 | + * (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding |
| 83 | + * k-th translation vector (see the next output parameter description) brings the board pattern |
| 84 | + * from the model coordinate space (in which object points are specified) to the world coordinate |
| 85 | + * space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1). |
| 86 | + * @param tvecs Output vector of translation vectors estimated for each pattern view. |
| 87 | + * @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters. |
| 88 | + * Order of deviations values: |
| 89 | + * \f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, |
| 90 | + * s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero. |
| 91 | + * @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters. |
| 92 | + * Order of deviations values: \f$(R_1, T_1, \dotsc , R_M, T_M)\f$ where M is number of pattern views, |
| 93 | + * \f$R_i, T_i\f$ are concatenated 1x3 vectors. |
| 94 | + * @param perViewErrors Output vector of average re-projection errors estimated for each pattern view. |
| 95 | + * @param flags flags Different flags for the calibration process (see #calibrateCamera for details). |
| 96 | + * @param criteria Termination criteria for the iterative optimization algorithm. |
| 97 | + * |
| 98 | + * This function calibrates a camera using a set of corners of a Charuco Board. The function |
| 99 | + * receives a list of detected corners and its identifiers from several views of the Board. |
| 100 | + * The function returns the final re-projection error. |
| 101 | + */ |
| 102 | +CV_EXPORTS_AS(calibrateCameraCharucoExtended) |
| 103 | +double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, |
| 104 | + const Ptr<CharucoBoard> &board, Size imageSize, InputOutputArray cameraMatrix, |
| 105 | + InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, |
| 106 | + OutputArray stdDeviationsIntrinsics, OutputArray stdDeviationsExtrinsics, |
| 107 | + OutputArray perViewErrors, int flags = 0, const TermCriteria& criteria = TermCriteria( |
| 108 | + TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)); |
| 109 | + |
| 110 | +/** |
| 111 | + * @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation. |
| 112 | + */ |
| 113 | +CV_EXPORTS_W double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds, |
| 114 | + const Ptr<CharucoBoard> &board, Size imageSize, |
| 115 | + InputOutputArray cameraMatrix, InputOutputArray distCoeffs, |
| 116 | + OutputArrayOfArrays rvecs = noArray(), |
| 117 | + OutputArrayOfArrays tvecs = noArray(), int flags = 0, |
| 118 | + const TermCriteria& criteria=TermCriteria(TermCriteria::COUNT + |
| 119 | + TermCriteria::EPS, 30, DBL_EPSILON)); |
| 120 | +//! @} |
| 121 | + |
| 122 | +} |
| 123 | +} |
| 124 | +#endif |
0 commit comments