nareshmlx/opencv-pr huggingface dataset:
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
this simplifies the api, old version available in contrib
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
> fixed wrong fix.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,151 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_DICTIONARY_HPP
+#define OPENCV_OBJDETECT_DICTIONARY_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
> `_bytesList` We should not use underscored prefixes for parameters in public files. It is unnecessary. This affects documentation and bindings.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
... (already reported problem)
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
To avoid compatibility issues, it is better to implement destructor on .cpp side (even for empty body). BTW, also this reduce compilation time.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
fixed all brief issues
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 30

**Code Changes:**
```diff
+class CV_EXPORTS_W_SIMPLE Dictionary {
+
+    public:
+    CV_PROP_RW Mat bytesList;         // marker code information
+    CV_PROP_RW int markerSize;        // number of bits per dimension
+    CV_PROP_RW int maxCorrectionBits; // maximum number of bits that can be corrected
+
+
+    CV_WRAP Dictionary();
+
+    CV_WRAP Dictionary(const Mat &bytesList, int _markerSize, int maxcorr = 0);
```

Review comment:
move to BoardImpl
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 42

**Code Changes:**
```diff
+
+
+    /** @brief Read a new dictionary from FileNode.
+     *
+     * Dictionary format:\n
+     * nmarkers: 35\n
+     * markersize: 6\n
+     * maxCorrectionBits: 5\n
+     * marker_0: "101011111011111001001001101100000000"\n
+     * ...\n
+     * marker_34: "011111010000111011111110110101100101"
```

Review comment:
fixed all brief issues
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
The structure is not used in this repo. It should stay in contrib.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,396 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+#define OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+
+#include <opencv2/objdetect/aruco_dictionary.hpp>
+#include <opencv2/objdetect/aruco_board.hpp>
+
```

Review comment:
It's redundant overload.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,396 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+#define OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+
+#include <opencv2/objdetect/aruco_dictionary.hpp>
+#include <opencv2/objdetect/aruco_board.hpp>
+
```

Review comment:
It's redundant. Public constructor is enough.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,151 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_DICTIONARY_HPP
+#define OPENCV_OBJDETECT_DICTIONARY_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
Why do we need it? There is `getPredefinedDictionary()` function.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,151 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_DICTIONARY_HPP
+#define OPENCV_OBJDETECT_DICTIONARY_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
Default dictionary is not usable.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,151 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_DICTIONARY_HPP
+#define OPENCV_OBJDETECT_DICTIONARY_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
Why do we need it as method?
**File:** modules/objdetect/include/opencv2/objdetect/aruco_dictionary.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,151 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_DICTIONARY_HPP
+#define OPENCV_OBJDETECT_DICTIONARY_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
Camel-case naming.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,396 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+#define OPENCV_OBJDETECT_ARUCO_DETECTOR_HPP
+
+#include <opencv2/objdetect/aruco_dictionary.hpp>
+#include <opencv2/objdetect/aruco_board.hpp>
+
```

Review comment:
No need to use Ptr<> for Parameters structure here. Just `const DetectorParameters&` works well.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
moved to contrib
**File:** apps/interactive-calibration/frameProcessor.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -79,7 +79,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
 
     std::vector<std::vector<cv::Point2f> > corners, rejected;
     std::vector<int> ids;
-    cv::aruco::detectMarkers(frame, mArucoDictionary, corners, ids, cv::aruco::DetectorParameters::create(), rejected);
+    cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected);
     cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected);
     cv::Mat currentCharucoCorners, currentCharucoIds;
     if(ids.size() > 0)
@@ -266,8 +266,8 @@ bool CalibProcessor::checkLastFrame()
```

Review comment:
use just ` const cv::aruco::DetectorParameters&` version as it simple structure.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_detector.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 80

**Code Changes:**
```diff
+        aprilTagDeglitch = 0;
+        detectInvertedMarker = false;
+        useAruco3Detection = false;
+        minSideLengthCanonicalImg = 32;
+        minMarkerLengthRatioOriginalImg = 0.0;
+    };
+
+    /** @brief Read a new set of DetectorParameters from FileNode (use FileStorage.root()).
+     */
+    CV_WRAP bool readDetectorParameters(const FileNode& fn);
+
```

Review comment:
You can just assign default values to all fields without constructor.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
It should not be public as we use PIMPL and create() method.
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
The same for create()
**File:** apps/interactive-calibration/frameProcessor.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -79,7 +79,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
 
     std::vector<std::vector<cv::Point2f> > corners, rejected;
     std::vector<int> ids;
-    cv::aruco::detectMarkers(frame, mArucoDictionary, corners, ids, cv::aruco::DetectorParameters::create(), rejected);
+    cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected);
     cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected);
     cv::Mat currentCharucoCorners, currentCharucoIds;
     if(ids.size() > 0)
@@ -266,8 +266,8 @@ bool CalibProcessor::checkLastFrame()
```

Review comment:
`detectMarkers()` is old API function
**File:** apps/interactive-calibration/frameProcessor.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 82

**Code Changes:**
```diff
@@ -79,7 +79,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
 
     std::vector<std::vector<cv::Point2f> > corners, rejected;
     std::vector<int> ids;
-    cv::aruco::detectMarkers(frame, mArucoDictionary, corners, ids, cv::aruco::DetectorParameters::create(), rejected);
+    cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected);
     cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected);
     cv::Mat currentCharucoCorners, currentCharucoIds;
     if(ids.size() > 0)
@@ -266,8 +266,8 @@ bool CalibProcessor::checkLastFrame()
         allObjPoints.reserve(mCurrentCharucoIds.total());
```

Review comment:
It makes sense to switch to new API.
**File:** apps/interactive-calibration/main.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 182

**Code Changes:**
```diff
@@ -180,8 +180,8 @@ int main(int argc, char** argv)
                 }
                 else {
 #ifdef HAVE_OPENCV_ARUCO
-                    cv::Ptr<cv::aruco::Dictionary> dictionary =
-                            cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME(capParams.charucoDictName));
+                    cv::aruco::Dictionary dictionary =
+                            cv::aruco::getPredefinedDictionary(cv::aruco::PredefinedDictionaryType(capParams.charucoDictName));
                     cv::Ptr<cv::aruco::CharucoBoard> charucoboard =
```

Review comment:
We always have Aruco since now.
**File:** apps/interactive-calibration/frameProcessor.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 82

**Code Changes:**
```diff
@@ -79,7 +79,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
 
     std::vector<std::vector<cv::Point2f> > corners, rejected;
     std::vector<int> ids;
-    cv::aruco::detectMarkers(frame, mArucoDictionary, corners, ids, cv::aruco::DetectorParameters::create(), rejected);
+    cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected);
     cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected);
     cv::Mat currentCharucoCorners, currentCharucoIds;
     if(ids.size() > 0)
@@ -266,8 +266,8 @@ bool CalibProcessor::checkLastFrame()
         allObjPoints.reserve(mCurrentCharucoIds.total());
```

Review comment:
There is `interpolateCornersCharuco()` call in frameProcessor.cpp: ``` cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected); cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected); cv::Mat currentCharucoCorners, currentCharucoIds; if(ids.size() > 0) cv::aruco::interpolateCornersCharuco(corners, ids, frame, mCharucoBoard, currentCharucoCorners, currentCharucoIds); ``` new API cannot resolve old API dependencies
**File:** apps/interactive-calibration/main.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 182

**Code Changes:**
```diff
@@ -180,8 +180,8 @@ int main(int argc, char** argv)
                 }
                 else {
 #ifdef HAVE_OPENCV_ARUCO
-                    cv::Ptr<cv::aruco::Dictionary> dictionary =
-                            cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME(capParams.charucoDictName));
+                    cv::aruco::Dictionary dictionary =
+                            cv::aruco::getPredefinedDictionary(cv::aruco::PredefinedDictionaryType(capParams.charucoDictName));
                     cv::Ptr<cv::aruco::CharucoBoard> charucoboard =
```

Review comment:
There is `interpolateCornersCharuco()` call in frameProcessor.cpp: ``` cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected); cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected); cv::Mat currentCharucoCorners, currentCharucoIds; if(ids.size() > 0) cv::aruco::interpolateCornersCharuco(corners, ids, frame, mCharucoBoard, currentCharucoCorners, currentCharucoIds); ``` new API cannot resolve old API dependencies
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,234 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+#ifndef OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+#define OPENCV_OBJDETECT_ARUCO_BOARD_HPP
+
+#include <opencv2/core.hpp>
+
+namespace cv {
```

Review comment:
removed public default constructor added
**File:** apps/interactive-calibration/frameProcessor.cpp
**Change Type:** modified
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -79,7 +79,7 @@ bool CalibProcessor::detectAndParseChAruco(const cv::Mat &frame)
 
     std::vector<std::vector<cv::Point2f> > corners, rejected;
     std::vector<int> ids;
-    cv::aruco::detectMarkers(frame, mArucoDictionary, corners, ids, cv::aruco::DetectorParameters::create(), rejected);
+    cv::aruco::detectMarkers(frame, cv::makePtr<cv::aruco::Dictionary>(mArucoDictionary), corners, ids, cv::makePtr<cv::aruco::DetectorParameters>(), rejected);
     cv::aruco::refineDetectedMarkers(frame, board, corners, ids, rejected);
     cv::Mat currentCharucoCorners, currentCharucoIds;
     if(ids.size() > 0)
@@ -266,8 +266,8 @@ bool CalibProcessor::checkLastFrame()
```

Review comment:
Will be updated with the next PR.
**File:** modules/objdetect/doc/objdetect.bib
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,20 @@
+@article{Aruco2014,
+  author = {S. Garrido-Jurado and R. Mu\~noz-Salinas and F.J. Madrid-Cuevas and M.J. Mar\'in-Jim\'enez}
+  title = {Automatic generation and detection of highly reliable fiducial markers under occlusion},
+  year = {2014},
+  pages = {2280 - 2292},
+  journal = {Pattern Recognition},
+  volume = {47},
+  number = {6},
+  issn = {0031-3203},
```

Review comment:
Need to align style with existed `opencv.bib`
**File:** modules/objdetect/include/opencv2/objdetect/aruco_board.hpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 150

**Code Changes:**
```diff
+    CV_WRAP float getMarkerSeparation() const;
+
+protected:
+    struct GridImpl;
+    Ptr<GridImpl> gridImpl;
+    friend class CharucoBoard;
+};
+
+/**
+ * @brief ChArUco board is a planar chessboard where the markers are placed inside the white squares of a chessboard.
+ *
```

Review comment:
Where is it used?
**File:** modules/objdetect/src/aruco/aruco_dictionary.cpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 10

**Code Changes:**
```diff
+#include "../precomp.hpp"
+#include "opencv2/core/hal/hal.hpp"
+
+#include "aruco_utils.hpp"
+#include "predefined_dictionaries.hpp"
+#include "apriltag/predefined_dictionaries_apriltag.hpp"
+#include <opencv2/objdetect/aruco_dictionary.hpp>
+
+namespace cv {
+namespace aruco {
+
```

Review comment:
20k lines + 15k line. What is `libobjdetect` binary size change?
**File:** modules/objdetect/src/aruco/aruco_dictionary.cpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,441 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "../precomp.hpp"
+#include "opencv2/core/hal/hal.hpp"
+
+#include "aruco_utils.hpp"
+#include "predefined_dictionaries.hpp"
```

Review comment:
again, `precomp.hpp` must go first.
**File:** modules/objdetect/src/aruco/aruco_dictionary.cpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository

**Code Changes:**
```diff
@@ -0,0 +1,441 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "../precomp.hpp"
+#include "opencv2/core/hal/hal.hpp"
+
+#include "aruco_utils.hpp"
+#include "predefined_dictionaries.hpp"
```

Review comment:
> `Ptr<FileStorage>& fs` We don't need `Ptr` here: - `FileStorage` is already a smart pointer over implementation. - no plants to capture lifetime of that object in this API. - significant part of OpenCV API already uses `FileStorage&`.
**File:** modules/objdetect/src/aruco/aruco_utils.cpp
**Change Type:** added
**Context:** PR #22368: move aruco from contrib to objdetect in main repository
**Review Line:** 6

**Code Changes:**
```diff
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html
+
+#include "../precomp.hpp"
+#include "aruco_utils.hpp"
+
+namespace cv {
+namespace aruco {
+using namespace std;
+
```

Review comment:
missing precomp.hpp