From d1fe61a467d930fd5f9c87b2486e6bacc970eec6 Mon Sep 17 00:00:00 2001 From: Aleksandr Panov Date: Fri, 8 Jul 2022 00:49:02 +0300 Subject: [PATCH] add CV_WRAP, add default Board constructor --- modules/aruco/include/opencv2/aruco/board.hpp | 6 ++++-- modules/aruco/include/opencv2/aruco_detector.hpp | 2 +- modules/aruco/src/board.cpp | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/aruco/include/opencv2/aruco/board.hpp b/modules/aruco/include/opencv2/aruco/board.hpp index c2cad319f..f76f2f36b 100644 --- a/modules/aruco/include/opencv2/aruco/board.hpp +++ b/modules/aruco/include/opencv2/aruco/board.hpp @@ -26,6 +26,8 @@ class Dictionary; */ class CV_EXPORTS_W Board { public: + CV_WRAP Board(); + /** @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 @@ -91,7 +93,7 @@ CV_EXPORTS_W void drawPlanarBoard(const Ptr &board, Size outSize, OutputA class CV_EXPORTS_W GridBoard : public Board { public: - CV_EXPORTS_W GridBoard(); + CV_WRAP GridBoard(); /** * @brief Draw a GridBoard * @@ -142,7 +144,7 @@ protected: */ class CV_EXPORTS_W CharucoBoard : public Board { public: - CharucoBoard(); + CV_WRAP CharucoBoard(); // vector of chessboard 3D corners precalculated CV_PROP std::vector chessboardCorners; diff --git a/modules/aruco/include/opencv2/aruco_detector.hpp b/modules/aruco/include/opencv2/aruco_detector.hpp index b13aa227e..f52e6d85b 100644 --- a/modules/aruco/include/opencv2/aruco_detector.hpp +++ b/modules/aruco/include/opencv2/aruco_detector.hpp @@ -306,7 +306,7 @@ public: * @param _params marker detection parameters * @param _refineParams marker refine detection parameters */ - ArucoDetector(const Ptr &_dictionary = getPredefinedDictionary(DICT_4X4_50), + CV_WRAP ArucoDetector(const Ptr &_dictionary = getPredefinedDictionary(DICT_4X4_50), const Ptr &_params = DetectorParameters::create(), const Ptr &_refineParams = RefineParameters::create()): dictionary(_dictionary), params(_params), refineParams(_refineParams) {} diff --git a/modules/aruco/src/board.cpp b/modules/aruco/src/board.cpp index 1901381c1..2920b4854 100644 --- a/modules/aruco/src/board.cpp +++ b/modules/aruco/src/board.cpp @@ -112,6 +112,8 @@ struct GridBoard::GridImpl { GridBoard::GridBoard(): gridImpl(makePtr()) {} +Board::Board(): dictionary(makePtr(getPredefinedDictionary(PREDEFINED_DICTIONARY_NAME::DICT_4X4_50))) {} + Ptr Board::create(InputArrayOfArrays objPoints, const Ptr &dictionary, InputArray ids) { CV_Assert(objPoints.total() == ids.total()); CV_Assert(objPoints.type() == CV_32FC3 || objPoints.type() == CV_32FC1);