1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #28824 from s-trinh:update_ArUco_doc

Update ArUco doc #28824

See https://github.com/opencv/opencv/pull/28823

Update of the ArUco doc but targeted for OpenCV 4.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
s-trinh
2026-05-20 14:05:51 +02:00
committed by GitHub
parent 7c7ee97493
commit 0abd5c86f7
26 changed files with 99 additions and 23 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

@@ -128,6 +128,65 @@
@sa @cite Aruco2014
This code has been originally developed by Sergio Garrido-Jurado as a project
for Google Summer of Code 2015 (GSoC 15).
<br>
@warning In OpenCV, the order of the returned corners locations for the AprilTag family is not aligned with the ArUco one.\n
Note that this order is also different from the convention adopted by the official [AprilTag library](https://github.com/AprilRobotics/apriltag/).
![](pics/AprilTag_corners_comparison_opencv_april.png) { width=80% }
<br>
An overview of the supported ArUco markers family is visible in the following image:
![](pics/ArUco_family.png) { width=80% }
<br>
An overview of the supported AprilTag markers family is visible in the following image:
![](pics/AprilTag_family.png) { width=80% }
@note The generated images (in the above picture) using @ref aruco::generateImageMarker for the AprilTag markers have been
rotated by 180 degree in order to match the official AprilTag images.
When using the @ref aruco::generateImageMarker function, it will output by default a different image from the official AprilTag convention,
see the [AprilRobotics/apriltag-imgs](https://github.com/AprilRobotics/apriltag-imgs) repository.
This is the reason why you see a different corners order between ArUco and AprilTag in the above image.
<br>
For the ArUco marker family, the recommended family is the DICT_ARUCO_MIP_36h12 one, [see](https://stackoverflow.com/a/51511558).
In general, a smaller marker family (e.g. `4x4` vs `6x6`) should give you a better detection rate with respect to the camera distance,
at the expense of having more probability to have issues with false detection or marker id decoding error.
The number of marker ids in a family is also something to take into account with respect to the application use case and the ability
to correct wrong bits during the marker id decoding process.
You can download some pregenerated MIP_36h12 ArUco marker images from:
- https://sourceforge.net/projects/aruco/files/
- or use the `samples/cpp/tutorial_code/objectDetection/create_marker.cpp` sample to generate the marker image for your
desired marker family (which uses the @ref aruco::generateImageMarker function)
For the AprilTag family, you can find some pregenerated marker images in the
[AprilRobotics/apriltag-imgs](https://github.com/AprilRobotics/apriltag-imgs) repository.
@note For accurate corners location extraction, a white border (to have a strong gradient between white and black transition) around the marker is important.
This is necessary to precisely extract the marker contour in difficult conditions such as bad illumination, confusing color background, etc.
<br>
There are multiple parameters which can be tweaked to improve the marker detection rate or to be adapted to your use case (e.g. image resolution).
Please refer to the:
- @ref aruco::DetectorParameters
- "Detector Parameters" section in the @ref tutorial_aruco_detection tutorial or in the @ref tutorial_aruco_faq page
- [ArUco Library Documentation](https://drive.google.com/file/d/1OiavRVYVJ-WH88sQg1LUsh8CuJZUQyrX) for additional information from the ArUco library
The corner refinement method can be changed according to the @ref aruco::CornerRefineMethod to improve the corners location accuracy
at the expense of more computation time.
<br>
To estimate the marker pose with respect to the camera frame, we recommend you to look at the following sources of information:
- @ref tutorial_aruco_detection for a tutorial about ArUco markers detection
- @ref calib3d for some theoretical background about the pinhole camera model and the @ref calib3d_solvePnP page
- @ref solvePnP, @ref solvePnPGeneric, @ref solveP3P for the relevant pose estimation methods
@}
@}