From 068be877ba1defc838780fa39b206727762dba8d Mon Sep 17 00:00:00 2001 From: ackimixs Date: Mon, 15 Jan 2024 21:28:30 +0100 Subject: [PATCH] 4.6 version of opencv --- arucoDetector.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arucoDetector.cpp b/arucoDetector.cpp index 3cce720..58731df 100644 --- a/arucoDetector.cpp +++ b/arucoDetector.cpp @@ -36,7 +36,9 @@ int main() cv::aruco::DetectorParameters detectorParams = cv::aruco::DetectorParameters(); cv::aruco::Dictionary dictionary = cv::aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_50); - cv::aruco::ArucoDetector detector(dictionary, detectorParams); + + // 4.9 + // cv::aruco::ArucoDetector detector(dictionary, detectorParams); while (true) { cv::Mat frame; @@ -52,7 +54,11 @@ int main() std::vector markerIds; std::vector> markerCorners; - detector.detectMarkers(frame, markerCorners, markerIds); + + cv::aruco::detectMarkers(frame, dictionary, markerCorners, markerIds, detectorParams); + + // 4.9 + // detector.detectMarkers(frame, markerCorners, markerIds); if (!markerIds.empty()) { cv::aruco::drawDetectedMarkers(frame, markerCorners, markerIds);