diff --git a/modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp b/modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp index d9f0fd86012..9fa202cec9e 100644 --- a/modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp +++ b/modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp @@ -27,7 +27,7 @@ enum PatternPos { * These pattern points define this coordinate system: * ![Image with axes drawn](images/singlemarkersaxes.jpg) */ - CCW_CENTER, + ARUCO_CCW_CENTER, /** @brief The marker coordinate system is centered on the top-left corner of the marker. * The coordinates of the four corners (CW order) of the marker in its own coordinate system are: * (0, 0, 0), (markerLength, 0, 0), @@ -38,11 +38,11 @@ enum PatternPos { * * These pattern dots are convenient to use with a chessboard/ChArUco board. */ - CW_TOP_LEFT_CORNER + ARUCO_CW_TOP_LEFT_CORNER }; /** @brief Pose estimation parameters - * @param pattern Defines center this system and axes direction (default PatternPos::CCW_CENTER). + * @param pattern Defines center this system and axes direction (default PatternPos::ARUCO_CCW_CENTER). * @param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses the provided * rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further * optimizes them (default false). @@ -54,7 +54,7 @@ struct CV_EXPORTS_W EstimateParameters { CV_PROP_RW bool useExtrinsicGuess; CV_PROP_RW SolvePnPMethod solvePnPMethod; - EstimateParameters(): pattern(CCW_CENTER), useExtrinsicGuess(false), + EstimateParameters(): pattern(ARUCO_CCW_CENTER), useExtrinsicGuess(false), solvePnPMethod(SOLVEPNP_ITERATIVE) {} CV_WRAP static Ptr create() { @@ -82,7 +82,7 @@ struct CV_EXPORTS_W EstimateParameters { * Each element in tvecs corresponds to the specific marker in imgPoints. * @param objPoints array of object points of all the marker corners * @param estimateParameters set the origin of coordinate system and the coordinates of the four corners of the marker - * (default estimateParameters.pattern = PatternPos::CCW_CENTER, estimateParameters.useExtrinsicGuess = false, + * (default estimateParameters.pattern = PatternPos::ARUCO_CCW_CENTER, estimateParameters.useExtrinsicGuess = false, * estimateParameters.solvePnPMethod = SOLVEPNP_ITERATIVE). * * This function receives the detected markers and returns their pose estimation respect to diff --git a/modules/aruco/include/opencv2/aruco/board.hpp b/modules/aruco/include/opencv2/aruco/board.hpp index bfde9a1debf..e0b4450e619 100644 --- a/modules/aruco/include/opencv2/aruco/board.hpp +++ b/modules/aruco/include/opencv2/aruco/board.hpp @@ -25,44 +25,40 @@ class Dictionary; * - The identifier of all the markers in the board. */ class CV_EXPORTS_W Board { - public: - /** - * @brief Provide way to create Board by passing necessary data. Specially needed in Python. - * - * @param objPoints array of object points of all the marker corners in the board - * @param dictionary the dictionary of markers employed for this board - * @param ids vector of the identifiers of the markers in the board - * - */ +public: + /** @brief Provide way to create Board by passing necessary data. Specially needed in Python. + * @param objPoints array of object points of all the marker corners in the board + * @param dictionary the dictionary of markers employed for this board + * @param ids vector of the identifiers of the markers in the board + */ CV_WRAP static Ptr create(InputArrayOfArrays objPoints, const Ptr &dictionary, InputArray ids); - /** - * @brief Set ids vector - * - * @param ids vector of the identifiers of the markers in the board (should be the same size - * as objPoints) - * - * Recommended way to set ids vector, which will fail if the size of ids does not match size - * of objPoints. - */ + /** @brief Set ids vector + * @param ids vector of the identifiers of the markers in the board (should be the same size + * as objPoints) + * + * Recommended way to set ids vector, which will fail if the size of ids does not match size + * of objPoints. + */ CV_WRAP void setIds(InputArray ids); - /// array of object points of all the marker corners in the board - /// each marker include its 4 corners in this order: - ///- objPoints[i][0] - left-top point of i-th marker - ///- objPoints[i][1] - right-top point of i-th marker - ///- objPoints[i][2] - right-bottom point of i-th marker - ///- objPoints[i][3] - left-bottom point of i-th marker - /// - /// Markers are placed in a certain order - row by row, left to right in every row. - /// For M markers, the size is Mx4. + /** @brief array of object points of all the marker corners in the board each marker include its 4 corners in this order: + * - objPoints[i][0] - left-top point of i-th marker + * - objPoints[i][1] - right-top point of i-th marker + * - objPoints[i][2] - right-bottom point of i-th marker + * - objPoints[i][3] - left-bottom point of i-th marker + * + * Markers are placed in a certain order - row by row, left to right in every row. + * For M markers, the size is Mx4. + */ CV_PROP std::vector > objPoints; /// the dictionary of markers employed for this board CV_PROP Ptr dictionary; - /// vector of the identifiers of the markers in the board (same size than objPoints) - /// The identifiers refers to the board dictionary + /** @brief vector of the identifiers of the markers in the board (same size than objPoints) + * The identifiers refers to the board dictionary + */ CV_PROP_RW std::vector ids; /// coordinate of the bottom right corner of the board, is set when calling the function create() @@ -173,9 +169,7 @@ class CV_EXPORTS_W CharucoBoard : public Board { CV_WRAP void draw(Size outSize, OutputArray img, int marginSize = 0, int borderBits = 1); - /** - * @brief Create a CharucoBoard object - * + /** @brief Create a CharucoBoard object * @param squaresX number of chessboard squares in X direction * @param squaresY number of chessboard squares in Y direction * @param squareLength chessboard square side length (normally in meters) diff --git a/modules/aruco/src/aruco_calib_pose.cpp b/modules/aruco/src/aruco_calib_pose.cpp index 6fea45ccb83..7f81643c43d 100644 --- a/modules/aruco/src/aruco_calib_pose.cpp +++ b/modules/aruco/src/aruco_calib_pose.cpp @@ -47,13 +47,13 @@ static Mat _getSingleMarkerObjectPoints(float markerLength, const EstimateParame CV_Assert(markerLength > 0); Mat objPoints(4, 1, CV_32FC3); // set coordinate system in the top-left corner of the marker, with Z pointing out - if (estimateParameters.pattern == CW_TOP_LEFT_CORNER) { + if (estimateParameters.pattern == ARUCO_CW_TOP_LEFT_CORNER) { objPoints.ptr(0)[0] = Vec3f(0.f, 0.f, 0); objPoints.ptr(0)[1] = Vec3f(markerLength, 0.f, 0); objPoints.ptr(0)[2] = Vec3f(markerLength, markerLength, 0); objPoints.ptr(0)[3] = Vec3f(0.f, markerLength, 0); } - else if (estimateParameters.pattern == CCW_CENTER) { + else if (estimateParameters.pattern == ARUCO_CCW_CENTER) { objPoints.ptr(0)[0] = Vec3f(-markerLength/2.f, markerLength/2.f, 0); objPoints.ptr(0)[1] = Vec3f(markerLength/2.f, markerLength/2.f, 0); objPoints.ptr(0)[2] = Vec3f(markerLength/2.f, -markerLength/2.f, 0); diff --git a/modules/aruco/test/test_charucodetection.cpp b/modules/aruco/test/test_charucodetection.cpp index e96281713c5..c819b37029c 100644 --- a/modules/aruco/test/test_charucodetection.cpp +++ b/modules/aruco/test/test_charucodetection.cpp @@ -441,7 +441,7 @@ void CV_CharucoDiamondDetection::run(int) { } Ptr estimateParameters = aruco::EstimateParameters::create(); - estimateParameters->pattern = aruco::CW_TOP_LEFT_CORNER; + estimateParameters->pattern = aruco::ARUCO_CW_TOP_LEFT_CORNER; // estimate diamond pose vector< Vec3d > estimatedRvec, estimatedTvec; aruco::estimatePoseSingleMarkers(diamondCorners, squareLength, cameraMatrix, distCoeffs, estimatedRvec,