Skip to content

Commit 0f030dd

Browse files
committed
aruco: forward drawAxis to drawFrameAxes
1 parent f26c983 commit 0f030dd

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

modules/aruco/include/opencv2/aruco.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,8 @@ CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays
471471
*
472472
* Given the pose estimation of a marker or board, this function draws the axis of the world
473473
* coordinate system, i.e. the system centered on the marker/board. Useful for debugging purposes.
474+
*
475+
* @deprecated use cv::drawFrameAxes
474476
*/
475477
CV_EXPORTS_W void drawAxis(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs,
476478
InputArray rvec, InputArray tvec, float length);

modules/aruco/src/aruco.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,30 +1731,12 @@ void drawDetectedMarkers(InputOutputArray _image, InputArrayOfArrays _corners,
17311731

17321732
/**
17331733
*/
1734-
void drawAxis(InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs,
1735-
InputArray _rvec, InputArray _tvec, float length) {
1736-
1737-
CV_Assert(_image.getMat().total() != 0 &&
1738-
(_image.getMat().channels() == 1 || _image.getMat().channels() == 3));
1739-
CV_Assert(length > 0);
1740-
1741-
// project axis points
1742-
vector< Point3f > axisPoints;
1743-
axisPoints.push_back(Point3f(0, 0, 0));
1744-
axisPoints.push_back(Point3f(length, 0, 0));
1745-
axisPoints.push_back(Point3f(0, length, 0));
1746-
axisPoints.push_back(Point3f(0, 0, length));
1747-
vector< Point2f > imagePoints;
1748-
projectPoints(axisPoints, _rvec, _tvec, _cameraMatrix, _distCoeffs, imagePoints);
1749-
1750-
// draw axis lines
1751-
line(_image, imagePoints[0], imagePoints[1], Scalar(0, 0, 255), 3);
1752-
line(_image, imagePoints[0], imagePoints[2], Scalar(0, 255, 0), 3);
1753-
line(_image, imagePoints[0], imagePoints[3], Scalar(255, 0, 0), 3);
1734+
void drawAxis(InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _rvec,
1735+
InputArray _tvec, float length)
1736+
{
1737+
drawFrameAxes(_image, _cameraMatrix, _distCoeffs, _rvec, _tvec, length, 3);
17541738
}
17551739

1756-
1757-
17581740
/**
17591741
*/
17601742
void drawMarker(const Ptr<Dictionary> &dictionary, int id, int sidePixels, OutputArray _img, int borderBits) {

0 commit comments

Comments
 (0)