mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-15 12:07:08 +08:00
fix docs/API
This commit is contained in:
@@ -12,8 +12,7 @@ namespace aruco {
|
||||
//! @addtogroup aruco
|
||||
//! @{
|
||||
|
||||
/** @brief
|
||||
* rvec/tvec define the right handed coordinate system of the marker.
|
||||
/** @brief rvec/tvec define the right handed coordinate system of the marker.
|
||||
* PatternPos defines center this system and axes direction.
|
||||
* Axis X (red color) - first coordinate, axis Y (green color) - second coordinate,
|
||||
* axis Z (blue color) - third coordinate.
|
||||
@@ -21,30 +20,29 @@ namespace aruco {
|
||||
*/
|
||||
enum PatternPos {
|
||||
/** @brief The marker coordinate system is centered on the middle of the marker.
|
||||
* The coordinates of the four corners (CCW order) of the marker in its own coordinate system are:
|
||||
* (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0),
|
||||
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0).
|
||||
*
|
||||
* These pattern points define this coordinate system:
|
||||
* 
|
||||
*/
|
||||
CCW_center,
|
||||
* The coordinates of the four corners (CCW order) of the marker in its own coordinate system are:
|
||||
* (-markerLength/2, markerLength/2, 0), (markerLength/2, markerLength/2, 0),
|
||||
* (markerLength/2, -markerLength/2, 0), (-markerLength/2, -markerLength/2, 0).
|
||||
*
|
||||
* These pattern points define this coordinate system:
|
||||
* 
|
||||
*/
|
||||
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),
|
||||
* (markerLength, markerLength, 0), (0, markerLength, 0).
|
||||
*
|
||||
* These pattern points define this coordinate system:
|
||||
* 
|
||||
*
|
||||
* These pattern dots are convenient to use with a chessboard/ChArUco board.
|
||||
*/
|
||||
CW_top_left_corner
|
||||
* The coordinates of the four corners (CW order) of the marker in its own coordinate system are:
|
||||
* (0, 0, 0), (markerLength, 0, 0),
|
||||
* (markerLength, markerLength, 0), (0, markerLength, 0).
|
||||
*
|
||||
* These pattern points define this coordinate system:
|
||||
* 
|
||||
*
|
||||
* These pattern dots are convenient to use with a chessboard/ChArUco board.
|
||||
*/
|
||||
CW_TOP_LEFT_CORNER
|
||||
};
|
||||
|
||||
/** @brief
|
||||
* Pose estimation parameters
|
||||
* @param pattern Defines center this system and axes direction (default PatternPos::CCW_center).
|
||||
/** @brief Pose estimation parameters
|
||||
* @param pattern Defines center this system and axes direction (default PatternPos::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).
|
||||
@@ -56,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(CCW_CENTER), useExtrinsicGuess(false),
|
||||
solvePnPMethod(SOLVEPNP_ITERATIVE) {}
|
||||
|
||||
CV_WRAP static Ptr<EstimateParameters> create() {
|
||||
@@ -82,9 +80,9 @@ struct CV_EXPORTS_W EstimateParameters {
|
||||
* Each element in rvecs corresponds to the specific marker in imgPoints.
|
||||
* @param tvecs array of output translation vectors (e.g. std::vector<cv::Vec3d>).
|
||||
* Each element in tvecs corresponds to the specific marker in imgPoints.
|
||||
* @param _objPoints array of object points of all the marker corners
|
||||
* @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::CCW_CENTER, estimateParameters.useExtrinsicGuess = false,
|
||||
* estimateParameters.solvePnPMethod = SOLVEPNP_ITERATIVE).
|
||||
*
|
||||
* This function receives the detected markers and returns their pose estimation respect to
|
||||
@@ -103,8 +101,8 @@ struct CV_EXPORTS_W EstimateParameters {
|
||||
*/
|
||||
CV_EXPORTS_W void estimatePoseSingleMarkers(InputArrayOfArrays corners, float markerLength,
|
||||
InputArray cameraMatrix, InputArray distCoeffs,
|
||||
OutputArray rvecs, OutputArray tvecs, OutputArray _objPoints = noArray(),
|
||||
Ptr<EstimateParameters> estimateParameters = EstimateParameters::create());
|
||||
OutputArray rvecs, OutputArray tvecs, OutputArray objPoints = noArray(),
|
||||
const Ptr<EstimateParameters>& estimateParameters = EstimateParameters::create());
|
||||
|
||||
/**
|
||||
* @brief Pose estimation for a board of markers
|
||||
@@ -193,16 +191,18 @@ double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArr
|
||||
Size imageSize, InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
|
||||
OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, OutputArray stdDeviationsIntrinsics,
|
||||
OutputArray stdDeviationsExtrinsics, OutputArray perViewErrors, int flags = 0,
|
||||
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
|
||||
const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
|
||||
|
||||
/** @brief It's the same function as #calibrateCameraAruco but without calibration error estimation.
|
||||
/**
|
||||
* @brief It's the same function as #calibrateCameraAruco but without calibration error estimation.
|
||||
* @overload
|
||||
*/
|
||||
CV_EXPORTS_W double calibrateCameraAruco(InputArrayOfArrays corners, InputArray ids, InputArray counter,
|
||||
const Ptr<Board> &board, Size imageSize, InputOutputArray cameraMatrix,
|
||||
InputOutputArray distCoeffs, OutputArrayOfArrays rvecs = noArray(),
|
||||
OutputArrayOfArrays tvecs = noArray(), int flags = 0,
|
||||
TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS,
|
||||
30, DBL_EPSILON));
|
||||
const TermCriteria& criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS,
|
||||
30, DBL_EPSILON));
|
||||
|
||||
/**
|
||||
* @brief Pose estimation for a ChArUco board given some of their corners
|
||||
@@ -267,17 +267,18 @@ double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArr
|
||||
const Ptr<CharucoBoard> &board, Size imageSize, InputOutputArray cameraMatrix,
|
||||
InputOutputArray distCoeffs, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
|
||||
OutputArray stdDeviationsIntrinsics, OutputArray stdDeviationsExtrinsics,
|
||||
OutputArray perViewErrors, int flags = 0, TermCriteria criteria = TermCriteria(
|
||||
OutputArray perViewErrors, int flags = 0, const TermCriteria& criteria = TermCriteria(
|
||||
TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON));
|
||||
|
||||
/** @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation.
|
||||
*/
|
||||
/**
|
||||
* @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation.
|
||||
*/
|
||||
CV_EXPORTS_W double calibrateCameraCharuco(InputArrayOfArrays charucoCorners, InputArrayOfArrays charucoIds,
|
||||
const Ptr<CharucoBoard> &board, Size imageSize,
|
||||
InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
|
||||
OutputArrayOfArrays rvecs = noArray(),
|
||||
OutputArrayOfArrays tvecs = noArray(), int flags = 0,
|
||||
TermCriteria criteria=TermCriteria(TermCriteria::COUNT +
|
||||
const TermCriteria& criteria=TermCriteria(TermCriteria::COUNT +
|
||||
TermCriteria::EPS, 30, DBL_EPSILON));
|
||||
//! @}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ class Dictionary;
|
||||
*/
|
||||
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
|
||||
@@ -36,14 +36,14 @@ class CV_EXPORTS_W Board {
|
||||
*/
|
||||
CV_WRAP static Ptr<Board> create(InputArrayOfArrays objPoints, const Ptr<Dictionary> &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.
|
||||
* of objPoints.
|
||||
*/
|
||||
CV_WRAP void setIds(InputArray ids);
|
||||
|
||||
|
@@ -285,8 +285,7 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
|
||||
* @brief The main functionality of ArucoDetector class is detection of markers in an image with detectMarkers() method.
|
||||
* After detecting some markers in the image, you can try to find undetected markers from this dictionary with
|
||||
* refineDetectedMarkers() method.
|
||||
* @see DetectorParameters, RefineParameters
|
||||
@@ -382,8 +381,8 @@ public:
|
||||
}
|
||||
|
||||
/** @brief simplified API for language bindings
|
||||
* @overload
|
||||
*/
|
||||
* @overload
|
||||
*/
|
||||
CV_WRAP void write(const String& fileName) const {
|
||||
FileStorage fs(fileName, FileStorage::WRITE);
|
||||
write(fs);
|
||||
|
@@ -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 == CW_TOP_LEFT_CORNER) {
|
||||
objPoints.ptr<Vec3f>(0)[0] = Vec3f(0.f, 0.f, 0);
|
||||
objPoints.ptr<Vec3f>(0)[1] = Vec3f(markerLength, 0.f, 0);
|
||||
objPoints.ptr<Vec3f>(0)[2] = Vec3f(markerLength, markerLength, 0);
|
||||
objPoints.ptr<Vec3f>(0)[3] = Vec3f(0.f, markerLength, 0);
|
||||
}
|
||||
else if (estimateParameters.pattern == CCW_center) {
|
||||
else if (estimateParameters.pattern == CCW_CENTER) {
|
||||
objPoints.ptr<Vec3f>(0)[0] = Vec3f(-markerLength/2.f, markerLength/2.f, 0);
|
||||
objPoints.ptr<Vec3f>(0)[1] = Vec3f(markerLength/2.f, markerLength/2.f, 0);
|
||||
objPoints.ptr<Vec3f>(0)[2] = Vec3f(markerLength/2.f, -markerLength/2.f, 0);
|
||||
@@ -67,7 +67,7 @@ static Mat _getSingleMarkerObjectPoints(float markerLength, const EstimateParame
|
||||
void estimatePoseSingleMarkers(InputArrayOfArrays _corners, float markerLength,
|
||||
InputArray _cameraMatrix, InputArray _distCoeffs,
|
||||
OutputArray _rvecs, OutputArray _tvecs, OutputArray _objPoints,
|
||||
Ptr<EstimateParameters> estimateParameters) {
|
||||
const Ptr<EstimateParameters>& estimateParameters) {
|
||||
CV_Assert(markerLength > 0);
|
||||
|
||||
Mat markerObjPoints = _getSingleMarkerObjectPoints(markerLength, *estimateParameters);
|
||||
@@ -178,7 +178,7 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
|
||||
OutputArray _stdDeviationsIntrinsics,
|
||||
OutputArray _stdDeviationsExtrinsics,
|
||||
OutputArray _perViewErrors,
|
||||
int flags, TermCriteria criteria) {
|
||||
int flags, const TermCriteria& criteria) {
|
||||
// for each frame, get properly processed imagePoints and objectPoints for the calibrateCamera
|
||||
// function
|
||||
vector<Mat> processedObjectPoints, processedImagePoints;
|
||||
@@ -212,7 +212,7 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
|
||||
|
||||
double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputArray _counter, const Ptr<Board> &board,
|
||||
Size imageSize, InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs,
|
||||
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, TermCriteria criteria) {
|
||||
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, const TermCriteria& criteria) {
|
||||
return calibrateCameraAruco(_corners, _ids, _counter, board, imageSize, _cameraMatrix, _distCoeffs,
|
||||
_rvecs, _tvecs, noArray(), noArray(), noArray(), flags, criteria);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
|
||||
OutputArray _stdDeviationsIntrinsics,
|
||||
OutputArray _stdDeviationsExtrinsics,
|
||||
OutputArray _perViewErrors,
|
||||
int flags, TermCriteria criteria) {
|
||||
int flags, const TermCriteria& criteria) {
|
||||
CV_Assert(_charucoIds.total() > 0 && (_charucoIds.total() == _charucoCorners.total()));
|
||||
|
||||
// Join object points of charuco corners in a single vector for calibrateCamera() function
|
||||
@@ -248,7 +248,7 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
|
||||
double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfArrays _charucoIds,
|
||||
const Ptr<CharucoBoard> &_board, Size imageSize, InputOutputArray _cameraMatrix,
|
||||
InputOutputArray _distCoeffs, OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs,
|
||||
int flags, TermCriteria criteria) {
|
||||
int flags, const TermCriteria& criteria) {
|
||||
return calibrateCameraCharuco(_charucoCorners, _charucoIds, _board, imageSize, _cameraMatrix, _distCoeffs, _rvecs,
|
||||
_tvecs, noArray(), noArray(), noArray(), flags, criteria);
|
||||
}
|
||||
|
@@ -441,7 +441,7 @@ void CV_CharucoDiamondDetection::run(int) {
|
||||
}
|
||||
|
||||
Ptr<aruco::EstimateParameters> estimateParameters = aruco::EstimateParameters::create();
|
||||
estimateParameters->pattern = aruco::CW_top_left_corner;
|
||||
estimateParameters->pattern = aruco::CW_TOP_LEFT_CORNER;
|
||||
// estimate diamond pose
|
||||
vector< Vec3d > estimatedRvec, estimatedTvec;
|
||||
aruco::estimatePoseSingleMarkers(diamondCorners, squareLength, cameraMatrix, distCoeffs, estimatedRvec,
|
||||
|
Reference in New Issue
Block a user