Skip to content

Commit 64804f0

Browse files
author
AleksandrPanov
committed
fix docs/API
1 parent 774faf3 commit 64804f0

File tree

5 files changed

+51
-51
lines changed

5 files changed

+51
-51
lines changed

modules/aruco/include/opencv2/aruco/aruco_calib_pose.hpp

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,37 @@ namespace aruco {
1212
//! @addtogroup aruco
1313
//! @{
1414

15-
/** @brief
16-
* rvec/tvec define the right handed coordinate system of the marker.
15+
/** @brief rvec/tvec define the right handed coordinate system of the marker.
1716
* PatternPos defines center this system and axes direction.
1817
* Axis X (red color) - first coordinate, axis Y (green color) - second coordinate,
1918
* axis Z (blue color) - third coordinate.
2019
* @sa estimatePoseSingleMarkers(), @ref tutorial_aruco_detection
2120
*/
2221
enum PatternPos {
2322
/** @brief The marker coordinate system is centered on the middle of the marker.
24-
* The coordinates of the four corners (CCW order) of the marker in its own coordinate system are:
25-
* (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0),
26-
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0).
27-
*
28-
* These pattern points define this coordinate system:
29-
* ![Image with axes drawn](images/singlemarkersaxes.jpg)
30-
*/
31-
CCW_center,
23+
* The coordinates of the four corners (CCW order) of the marker in its own coordinate system are:
24+
* (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0),
25+
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0).
26+
*
27+
* These pattern points define this coordinate system:
28+
* ![Image with axes drawn](images/singlemarkersaxes.jpg)
29+
*/
30+
CCW_CENTER,
3231
/** @brief The marker coordinate system is centered on the top-left corner of the marker.
33-
* The coordinates of the four corners (CW order) of the marker in its own coordinate system are:
34-
* (0, 0, 0), (markerLength, 0, 0),
35-
* (markerLength, markerLength, 0), (0, markerLength, 0).
36-
*
37-
* These pattern points define this coordinate system:
38-
* ![Image with axes drawn](images/singlemarkersaxes2.jpg)
39-
*
40-
* These pattern dots are convenient to use with a chessboard/ChArUco board.
41-
*/
42-
CW_top_left_corner
32+
* The coordinates of the four corners (CW order) of the marker in its own coordinate system are:
33+
* (0, 0, 0), (markerLength, 0, 0),
34+
* (markerLength, markerLength, 0), (0, markerLength, 0).
35+
*
36+
* These pattern points define this coordinate system:
37+
* ![Image with axes drawn](images/singlemarkersaxes2.jpg)
38+
*
39+
* These pattern dots are convenient to use with a chessboard/ChArUco board.
40+
*/
41+
CW_TOP_LEFT_CORNER
4342
};
4443

45-
/** @brief
46-
* Pose estimation parameters
47-
* @param pattern Defines center this system and axes direction (default PatternPos::CCW_center).
44+
/** @brief Pose estimation parameters
45+
* @param pattern Defines center this system and axes direction (default PatternPos::CCW_CENTER).
4846
* @param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses the provided
4947
* rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further
5048
* optimizes them (default false).
@@ -56,7 +54,7 @@ struct CV_EXPORTS_W EstimateParameters {
5654
CV_PROP_RW bool useExtrinsicGuess;
5755
CV_PROP_RW SolvePnPMethod solvePnPMethod;
5856

59-
EstimateParameters(): pattern(CCW_center), useExtrinsicGuess(false),
57+
EstimateParameters(): pattern(CCW_CENTER), useExtrinsicGuess(false),
6058
solvePnPMethod(SOLVEPNP_ITERATIVE) {}
6159

6260
CV_WRAP static Ptr<EstimateParameters> create() {
@@ -82,9 +80,9 @@ struct CV_EXPORTS_W EstimateParameters {
8280
* Each element in rvecs corresponds to the specific marker in imgPoints.
8381
* @param tvecs array of output translation vectors (e.g. std::vector<cv::Vec3d>).
8482
* Each element in tvecs corresponds to the specific marker in imgPoints.
85-
* @param _objPoints array of object points of all the marker corners
83+
* @param objPoints array of object points of all the marker corners
8684
* @param estimateParameters set the origin of coordinate system and the coordinates of the four corners of the marker
87-
* (default estimateParameters.pattern = PatternPos::CCW_center, estimateParameters.useExtrinsicGuess = false,
85+
* (default estimateParameters.pattern = PatternPos::CCW_CENTER, estimateParameters.useExtrinsicGuess = false,
8886
* estimateParameters.solvePnPMethod = SOLVEPNP_ITERATIVE).
8987
*
9088
* This function receives the detected markers and returns their pose estimation respect to
@@ -103,8 +101,8 @@ struct CV_EXPORTS_W EstimateParameters {
103101
*/
104102
CV_EXPORTS_W void estimatePoseSingleMarkers(InputArrayOfArrays corners, float markerLength,
105103
InputArray cameraMatrix, InputArray distCoeffs,
106-
OutputArray rvecs, OutputArray tvecs, OutputArray _objPoints = noArray(),
107-
Ptr<EstimateParameters> estimateParameters = EstimateParameters::create());
104+
OutputArray rvecs, OutputArray tvecs, OutputArray objPoints = noArray(),
105+
const Ptr<EstimateParameters>& estimateParameters = EstimateParameters::create());
108106

109107
/**
110108
* @brief Pose estimation for a board of markers
@@ -193,16 +191,18 @@ double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArr
193191
Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
194192
OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, OutputArray stdDeviationsIntrinsics,
195193
OutputArray stdDeviationsExtrinsics, OutputArray perViewErrors, int flags = 0,
196-
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
194+
const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
197195

198-
/** @brief It's the same function as #calibrateCameraAruco but without calibration error estimation.
196+
/**
197+
* @brief It's the same function as #calibrateCameraAruco but without calibration error estimation.
198+
* @overload
199199
*/
200200
CV_EXPORTS_W double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArray counter,
201201
const Ptr<Board> &board, Size imageSize, InputOutputArray cameraMatrix,
202202
InputOutputArray distCoeffs, OutputArrayOfArrays rvecs = noArray(),
203203
OutputArrayOfArrays tvecs = noArray(), int flags = 0,
204-
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS,
205-
30, DBL_EPSILON));
204+
const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS,
205+
30, DBL_EPSILON));
206206

207207
/**
208208
* @brief Pose estimation for a ChArUco board given some of their corners
@@ -267,17 +267,18 @@ double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArr
267267
const Ptr<CharucoBoard> &board, Size imageSize, InputOutputArray cameraMatrix,
268268
InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
269269
OutputArray stdDeviationsIntrinsics, OutputArray stdDeviationsExtrinsics,
270-
OutputArray perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(
270+
OutputArray perViewErrors, int flags = 0, const TermCriteria& criteria = TermCriteria(
271271
TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
272272

273-
/** @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation.
274-
*/
273+
/**
274+
* @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation.
275+
*/
275276
CV_EXPORTS_W double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds,
276277
const Ptr<CharucoBoard> &board, Size imageSize,
277278
InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
278279
OutputArrayOfArrays rvecs = noArray(),
279280
OutputArrayOfArrays tvecs = noArray(), int flags = 0,
280-
TermCriteria criteria=TermCriteria(TermCriteria::COUNT +
281+
const TermCriteria& criteria=TermCriteria(TermCriteria::COUNT +
281282
TermCriteria::EPS, 30, DBL_EPSILON));
282283
//! @}
283284

modules/aruco/include/opencv2/aruco/board.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Dictionary;
2626
*/
2727
class CV_EXPORTS_W Board {
2828
public:
29-
/**
29+
/**
3030
* @brief Provide way to create Board by passing necessary data. Specially needed in Python.
3131
*
3232
* @param objPoints array of object points of all the marker corners in the board
@@ -36,14 +36,14 @@ class CV_EXPORTS_W Board {
3636
*/
3737
CV_WRAP static Ptr<Board> create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &dictionary, InputArray ids);
3838

39-
/**
39+
/**
4040
* @brief Set ids vector
4141
*
4242
* @param ids vector of the identifiers of the markers in the board (should be the same size
4343
* as objPoints)
4444
*
4545
* Recommended way to set ids vector, which will fail if the size of ids does not match size
46-
* of objPoints.
46+
* of objPoints.
4747
*/
4848
CV_WRAP void setIds(InputArray ids);
4949

modules/aruco/include/opencv2/aruco_detector.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ struct CV_EXPORTS_W RefineParameters {
285285
};
286286

287287
/**
288-
* @brief
289-
* The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
288+
* @brief The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
290289
* After detecting some markers in the image, you can try to find undetected markers from this dictionary with
291290
* refineDetectedMarkers() method.
292291
* @see DetectorParameters, RefineParameters
@@ -382,8 +381,8 @@ class CV_EXPORTS_W ArucoDetector : public Algorithm
382381
}
383382

384383
/** @brief simplified API for language bindings
385-
* @overload
386-
*/
384+
* @overload
385+
*/
387386
CV_WRAP void write(const String& fileName) const {
388387
FileStorage fs(fileName, FileStorage::WRITE);
389388
write(fs);

modules/aruco/src/aruco_calib_pose.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ static Mat _getSingleMarkerObjectPoints(float markerLength, const EstimateParame
4747
CV_Assert(markerLength > 0);
4848
Mat objPoints(4, 1, CV_32FC3);
4949
// set coordinate system in the top-left corner of the marker, with Z pointing out
50-
if (estimateParameters.pattern == CW_top_left_corner) {
50+
if (estimateParameters.pattern == CW_TOP_LEFT_CORNER) {
5151
objPoints.ptr<Vec3f>(0)[0] = Vec3f(0.f, 0.f, 0);
5252
objPoints.ptr<Vec3f>(0)[1] = Vec3f(markerLength, 0.f, 0);
5353
objPoints.ptr<Vec3f>(0)[2] = Vec3f(markerLength, markerLength, 0);
5454
objPoints.ptr<Vec3f>(0)[3] = Vec3f(0.f, markerLength, 0);
5555
}
56-
else if (estimateParameters.pattern == CCW_center) {
56+
else if (estimateParameters.pattern == CCW_CENTER) {
5757
objPoints.ptr<Vec3f>(0)[0] = Vec3f(-markerLength/2.f, markerLength/2.f, 0);
5858
objPoints.ptr<Vec3f>(0)[1] = Vec3f(markerLength/2.f, markerLength/2.f, 0);
5959
objPoints.ptr<Vec3f>(0)[2] = Vec3f(markerLength/2.f, -markerLength/2.f, 0);
@@ -67,7 +67,7 @@ static Mat _getSingleMarkerObjectPoints(float markerLength, const EstimateParame
6767
void estimatePoseSingleMarkers(InputArrayOfArrays _corners, float markerLength,
6868
InputArray _cameraMatrix, InputArray _distCoeffs,
6969
OutputArray _rvecs, OutputArray _tvecs, OutputArray _objPoints,
70-
Ptr<EstimateParameters> estimateParameters) {
70+
const Ptr<EstimateParameters>& estimateParameters) {
7171
CV_Assert(markerLength > 0);
7272

7373
Mat markerObjPoints = _getSingleMarkerObjectPoints(markerLength, *estimateParameters);
@@ -178,7 +178,7 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
178178
OutputArray _stdDeviationsIntrinsics,
179179
OutputArray _stdDeviationsExtrinsics,
180180
OutputArray _perViewErrors,
181-
int flags, TermCriteria criteria) {
181+
int flags, const TermCriteria& criteria) {
182182
// for each frame, get properly processed imagePoints and objectPoints for the calibrateCamera
183183
// function
184184
vector<Mat> processedObjectPoints, processedImagePoints;
@@ -212,7 +212,7 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
212212

213213
double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputArray _counter, const Ptr<Board> &board,
214214
Size imageSize, InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs,
215-
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, TermCriteria criteria) {
215+
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, const TermCriteria& criteria) {
216216
return calibrateCameraAruco(_corners, _ids, _counter, board, imageSize, _cameraMatrix, _distCoeffs,
217217
_rvecs, _tvecs, noArray(), noArray(), noArray(), flags, criteria);
218218
}
@@ -224,7 +224,7 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
224224
OutputArray _stdDeviationsIntrinsics,
225225
OutputArray _stdDeviationsExtrinsics,
226226
OutputArray _perViewErrors,
227-
int flags, TermCriteria criteria) {
227+
int flags, const TermCriteria& criteria) {
228228
CV_Assert(_charucoIds.total() > 0 && (_charucoIds.total() == _charucoCorners.total()));
229229

230230
// Join object points of charuco corners in a single vector for calibrateCamera() function
@@ -248,7 +248,7 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
248248
double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfArrays _charucoIds,
249249
const Ptr<CharucoBoard> &_board, Size imageSize, InputOutputArray _cameraMatrix,
250250
InputOutputArray _distCoeffs, OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs,
251-
int flags, TermCriteria criteria) {
251+
int flags, const TermCriteria& criteria) {
252252
return calibrateCameraCharuco(_charucoCorners, _charucoIds, _board, imageSize, _cameraMatrix, _distCoeffs, _rvecs,
253253
_tvecs, noArray(), noArray(), noArray(), flags, criteria);
254254
}

modules/aruco/test/test_charucodetection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void CV_CharucoDiamondDetection::run(int) {
441441
}
442442

443443
Ptr<aruco::EstimateParameters> estimateParameters = aruco::EstimateParameters::create();
444-
estimateParameters->pattern = aruco::CW_top_left_corner;
444+
estimateParameters->pattern = aruco::CW_TOP_LEFT_CORNER;
445445
// estimate diamond pose
446446
vector< Vec3d > estimatedRvec, estimatedTvec;
447447
aruco::estimatePoseSingleMarkers(diamondCorners, squareLength, cameraMatrix, distCoeffs, estimatedRvec,

0 commit comments

Comments
 (0)