From 0f030dd002e0daaa9f5c4ba705796cb56b8e9bff Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Tue, 9 Apr 2019 11:30:15 +0200 Subject: [PATCH] aruco: forward drawAxis to drawFrameAxes --- modules/aruco/include/opencv2/aruco.hpp | 2 ++ modules/aruco/src/aruco.cpp | 26 ++++--------------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/modules/aruco/include/opencv2/aruco.hpp b/modules/aruco/include/opencv2/aruco.hpp index ba802a6fbaa..45a3f6c24d5 100644 --- a/modules/aruco/include/opencv2/aruco.hpp +++ b/modules/aruco/include/opencv2/aruco.hpp @@ -471,6 +471,8 @@ CV_EXPORTS_W void drawDetectedMarkers(InputOutputArray image, InputArrayOfArrays * * Given the pose estimation of a marker or board, this function draws the axis of the world * coordinate system, i.e. the system centered on the marker/board. Useful for debugging purposes. + * + * @deprecated use cv::drawFrameAxes */ CV_EXPORTS_W void drawAxis(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs, InputArray rvec, InputArray tvec, float length); diff --git a/modules/aruco/src/aruco.cpp b/modules/aruco/src/aruco.cpp index 76cd9edb3e2..8022076cf94 100644 --- a/modules/aruco/src/aruco.cpp +++ b/modules/aruco/src/aruco.cpp @@ -1731,30 +1731,12 @@ void drawDetectedMarkers(InputOutputArray _image, InputArrayOfArrays _corners, /** */ -void drawAxis(InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs, - InputArray _rvec, InputArray _tvec, float length) { - - CV_Assert(_image.getMat().total() != 0 && - (_image.getMat().channels() == 1 || _image.getMat().channels() == 3)); - CV_Assert(length > 0); - - // project axis points - vector< Point3f > axisPoints; - axisPoints.push_back(Point3f(0, 0, 0)); - axisPoints.push_back(Point3f(length, 0, 0)); - axisPoints.push_back(Point3f(0, length, 0)); - axisPoints.push_back(Point3f(0, 0, length)); - vector< Point2f > imagePoints; - projectPoints(axisPoints, _rvec, _tvec, _cameraMatrix, _distCoeffs, imagePoints); - - // draw axis lines - line(_image, imagePoints[0], imagePoints[1], Scalar(0, 0, 255), 3); - line(_image, imagePoints[0], imagePoints[2], Scalar(0, 255, 0), 3); - line(_image, imagePoints[0], imagePoints[3], Scalar(255, 0, 0), 3); +void drawAxis(InputOutputArray _image, InputArray _cameraMatrix, InputArray _distCoeffs, InputArray _rvec, + InputArray _tvec, float length) +{ + drawFrameAxes(_image, _cameraMatrix, _distCoeffs, _rvec, _tvec, length, 3); } - - /** */ void drawMarker(const Ptr &dictionary, int id, int sidePixels, OutputArray _img, int borderBits) {