diff --git a/apps/interactive-calibration/main.cpp b/apps/interactive-calibration/main.cpp index 889a536a69..ab0fa15ffd 100644 --- a/apps/interactive-calibration/main.cpp +++ b/apps/interactive-calibration/main.cpp @@ -52,7 +52,7 @@ const char* keys = "DICT_4X4_50, DICT_4X4_100, DICT_4X4_250, DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, " "DICT_5X5_1000, DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, DICT_7X7_100, " "DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, " - "DICT_APRILTAG_36h10, DICT_APRILTAG_36h11 }" + "DICT_APRILTAG_36h10, DICT_APRILTAG_36h11, DICT_ARUCO_MIP_36h12 }" "{fad | None | name of file with ArUco dictionary}" "{of | cameraParameters.xml | Output file name}" "{ft | true | Auto tuning of calibration flags}" diff --git a/apps/interactive-calibration/parametersController.cpp b/apps/interactive-calibration/parametersController.cpp index 48639a2bdb..66fd769fbb 100644 --- a/apps/interactive-calibration/parametersController.cpp +++ b/apps/interactive-calibration/parametersController.cpp @@ -175,6 +175,7 @@ bool calib::parametersController::loadFromParser(cv::CommandLineParser &parser) else if (arucoDictName == "DICT_APRILTAG_25h9") { mCapParams.charucoDictName = cv::aruco::DICT_APRILTAG_25h9; } else if (arucoDictName == "DICT_APRILTAG_36h10") { mCapParams.charucoDictName = cv::aruco::DICT_APRILTAG_36h10; } else if (arucoDictName == "DICT_APRILTAG_36h11") { mCapParams.charucoDictName = cv::aruco::DICT_APRILTAG_36h11; } + else if (arucoDictName == "DICT_ARUCO_MIP_36h12") { mCapParams.charucoDictName = cv::aruco::DICT_ARUCO_MIP_36h12; } else { std::cout << "incorrect name of aruco dictionary \n"; return false; diff --git a/apps/pattern-tools/DICT_ARUCO_MIP_36h12.json.gz b/apps/pattern-tools/DICT_ARUCO_MIP_36h12.json.gz new file mode 100644 index 0000000000..60734621e6 Binary files /dev/null and b/apps/pattern-tools/DICT_ARUCO_MIP_36h12.json.gz differ diff --git a/apps/pattern-tools/test_charuco_board.py b/apps/pattern-tools/test_charuco_board.py index e92a38a216..6e52a1e785 100644 --- a/apps/pattern-tools/test_charuco_board.py +++ b/apps/pattern-tools/test_charuco_board.py @@ -20,10 +20,10 @@ class aruco_objdetect_test(NewOpenCVTests): square_size = 100 aruco_type = [cv.aruco.DICT_4X4_1000, cv.aruco.DICT_5X5_1000, cv.aruco.DICT_6X6_1000, cv.aruco.DICT_7X7_1000, cv.aruco.DICT_ARUCO_ORIGINAL, cv.aruco.DICT_APRILTAG_16h5, - cv.aruco.DICT_APRILTAG_25h9, cv.aruco.DICT_APRILTAG_36h10, cv.aruco.DICT_APRILTAG_36h11] + cv.aruco.DICT_APRILTAG_25h9, cv.aruco.DICT_APRILTAG_36h10, cv.aruco.DICT_APRILTAG_36h11, cv.aruco.DICT_ARUCO_MIP_36h12] aruco_type_str = ['DICT_4X4_1000','DICT_5X5_1000', 'DICT_6X6_1000', 'DICT_7X7_1000', 'DICT_ARUCO_ORIGINAL', 'DICT_APRILTAG_16h5', - 'DICT_APRILTAG_25h9', 'DICT_APRILTAG_36h10', 'DICT_APRILTAG_36h11'] + 'DICT_APRILTAG_25h9', 'DICT_APRILTAG_36h10', 'DICT_APRILTAG_36h11', 'DICT_ARUCO_MIP_36h12'] marker_size = 0.8*square_size board_width = cols*square_size board_height = rows*square_size diff --git a/doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown b/doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown index edd43866e7..dd4ae483df 100644 --- a/doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown +++ b/doc/tutorials/objdetect/aruco_detection/aruco_detection.markdown @@ -144,7 +144,7 @@ Error correction techniques are employed when necessary. Consider the following image: -![Image with an assortment of markers](images/singlemarkerssource.jpg) +![Image with an assortment of markers](images/singlemarkerssource.jpg) { width=70% } And a printout of this image in a photo: diff --git a/doc/tutorials/tutorials.markdown b/doc/tutorials/tutorials.markdown index cd83c241af..d6e7cf2168 100644 --- a/doc/tutorials/tutorials.markdown +++ b/doc/tutorials/tutorials.markdown @@ -6,7 +6,7 @@ OpenCV Tutorials {#tutorial_root} - @subpage tutorial_table_of_content_imgproc - image processing functions - @subpage tutorial_table_of_content_app - application utils (GUI, image/video input/output) - @subpage tutorial_table_of_content_calib3d - extract 3D world information from 2D images -- @subpage tutorial_table_of_content_objdetect - INSERT OBJDETECT MODULE INFO +- @subpage tutorial_table_of_content_objdetect - detect ArUco markers and other calibration boards - @subpage tutorial_table_of_content_features2d - feature detectors, descriptors and matching framework - @subpage tutorial_table_of_content_dnn - infer neural networks using built-in _dnn_ module - @subpage tutorial_table_of_content_gapi - graph-based approach to computer vision algorithms building diff --git a/modules/objdetect/doc/pics/AprilTag_corners_comparison_opencv_april.png b/modules/objdetect/doc/pics/AprilTag_corners_comparison_opencv_april.png new file mode 100644 index 0000000000..3e794fe148 Binary files /dev/null and b/modules/objdetect/doc/pics/AprilTag_corners_comparison_opencv_april.png differ diff --git a/modules/objdetect/doc/pics/AprilTag_family.png b/modules/objdetect/doc/pics/AprilTag_family.png new file mode 100644 index 0000000000..cb9127a85a Binary files /dev/null and b/modules/objdetect/doc/pics/AprilTag_family.png differ diff --git a/modules/objdetect/doc/pics/ArUco_family.png b/modules/objdetect/doc/pics/ArUco_family.png new file mode 100644 index 0000000000..0bdca9c32d Binary files /dev/null and b/modules/objdetect/doc/pics/ArUco_family.png differ diff --git a/modules/objdetect/include/opencv2/objdetect.hpp b/modules/objdetect/include/opencv2/objdetect.hpp index 4a8544b910..946c888903 100644 --- a/modules/objdetect/include/opencv2/objdetect.hpp +++ b/modules/objdetect/include/opencv2/objdetect.hpp @@ -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). + +
+ + @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% } + +
+ + An overview of the supported ArUco markers family is visible in the following image: + ![](pics/ArUco_family.png) { width=80% } + +
+ + 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. + +
+ + 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. + +
+ + 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. + +
+ + 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 @} @} diff --git a/samples/cpp/aruco_dict_utils.cpp b/samples/cpp/aruco_dict_utils.cpp index 20fecd82e9..e9a40e8d50 100644 --- a/samples/cpp/aruco_dict_utils.cpp +++ b/samples/cpp/aruco_dict_utils.cpp @@ -260,7 +260,7 @@ const char* keys = "DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50," "DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL," "DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10," - "DICT_APRILTAG_36h11}" + "DICT_APRILTAG_36h11, DICT_ARUCO_MIP_36h12}" "{nMarkers | | Number of markers in the dictionary }" "{markerSize | | Marker size }" "{cd | | Input file with custom dictionary }"; @@ -309,6 +309,7 @@ int main(int argc, char *argv[]) else if (arucoDictName == "DICT_APRILTAG_25h9") { arucoDict = cv::aruco::DICT_APRILTAG_25h9; } else if (arucoDictName == "DICT_APRILTAG_36h10") { arucoDict = cv::aruco::DICT_APRILTAG_36h10; } else if (arucoDictName == "DICT_APRILTAG_36h11") { arucoDict = cv::aruco::DICT_APRILTAG_36h11; } + else if (arucoDictName == "DICT_ARUCO_MIP_36h12") { arucoDict = cv::aruco::DICT_ARUCO_MIP_36h12; } else { cout << "incorrect name of aruco dictionary \n"; return 1; @@ -328,13 +329,14 @@ int main(int argc, char *argv[]) cerr << "Dictionary not specified" << endl; return 0; } + if (!outputFile.empty() && nMarkers > 0 && markerSize > 0) { FileStorage fs(outputFile, FileStorage::WRITE); if (checkFlippedMarkers) - dictionary = generateCustomAsymmetricDictionary(nMarkers, markerSize, aruco::Dictionary(), 0); + dictionary = generateCustomAsymmetricDictionary(nMarkers, markerSize, dictionary, 0); else - dictionary = aruco::extendDictionary(nMarkers, markerSize, aruco::Dictionary(), 0); + dictionary = aruco::extendDictionary(nMarkers, markerSize, dictionary, 0); dictionary.writeDictionary(fs); } diff --git a/samples/cpp/calibration.cpp b/samples/cpp/calibration.cpp index 99cb1a547b..3294a93d76 100644 --- a/samples/cpp/calibration.cpp +++ b/samples/cpp/calibration.cpp @@ -66,7 +66,7 @@ static void help(char** argv) "DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, " "DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, " "DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, " - "DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11\n" + "DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11, DICT_ARUCO_MIP_36h12\n" " [-adf=] # Custom aruco dictionary file for ChArUco board\n" " [-o=] # the output filename for intrinsic [and extrinsic] parameters\n" " [-op] # write detected feature points\n" @@ -458,6 +458,7 @@ int main( int argc, char** argv ) else if (arucoDictName == "DICT_APRILTAG_25h9") { arucoDict = cv::aruco::DICT_APRILTAG_25h9; } else if (arucoDictName == "DICT_APRILTAG_36h10") { arucoDict = cv::aruco::DICT_APRILTAG_36h10; } else if (arucoDictName == "DICT_APRILTAG_36h11") { arucoDict = cv::aruco::DICT_APRILTAG_36h11; } + else if (arucoDictName == "DICT_ARUCO_MIP_36h12") { arucoDict = cv::aruco::DICT_ARUCO_MIP_36h12; } else { cout << "Incorrect Aruco dictionary name " << arucoDictName << std::endl; return 1; diff --git a/samples/cpp/stereo_calib.cpp b/samples/cpp/stereo_calib.cpp index c583c8fa09..e6ce6adb25 100644 --- a/samples/cpp/stereo_calib.cpp +++ b/samples/cpp/stereo_calib.cpp @@ -58,7 +58,7 @@ static int print_help(char** argv) << "DICT_4X4_1000, DICT_5X5_50, DICT_5X5_100, DICT_5X5_250, DICT_5X5_1000, " << "DICT_6X6_50, DICT_6X6_100, DICT_6X6_250, DICT_6X6_1000, DICT_7X7_50, " << "DICT_7X7_100, DICT_7X7_250, DICT_7X7_1000, DICT_ARUCO_ORIGINAL, " - << "DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11\n"; + << "DICT_APRILTAG_16h5, DICT_APRILTAG_25h9, DICT_APRILTAG_36h10, DICT_APRILTAG_36h11, DICT_ARUCO_MIP_36h12\n"; return 0; } @@ -435,6 +435,7 @@ int main(int argc, char** argv) else if (arucoDictName == "DICT_APRILTAG_25h9") { arucoDict = cv::aruco::DICT_APRILTAG_25h9; } else if (arucoDictName == "DICT_APRILTAG_36h10") { arucoDict = cv::aruco::DICT_APRILTAG_36h10; } else if (arucoDictName == "DICT_APRILTAG_36h11") { arucoDict = cv::aruco::DICT_APRILTAG_36h11; } + else if (arucoDictName == "DICT_ARUCO_MIP_36h12") { arucoDict = cv::aruco::DICT_ARUCO_MIP_36h12; } else { cout << "incorrect name of aruco dictionary \n"; return 1; diff --git a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp index 98f1a10a0c..2c417caae8 100644 --- a/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp +++ b/samples/cpp/tutorial_code/calib3d/camera_calibration/camera_calibration.cpp @@ -339,6 +339,7 @@ int main(int argc, char* argv[]) else if (s.arucoDictName == "DICT_APRILTAG_25h9") { arucoDict = cv::aruco::DICT_APRILTAG_25h9; } else if (s.arucoDictName == "DICT_APRILTAG_36h10") { arucoDict = cv::aruco::DICT_APRILTAG_36h10; } else if (s.arucoDictName == "DICT_APRILTAG_36h11") { arucoDict = cv::aruco::DICT_APRILTAG_36h11; } + else if (s.arucoDictName == "DICT_ARUCO_MIP_36h12") { arucoDict = cv::aruco::DICT_ARUCO_MIP_36h12; } else { cout << "incorrect name of aruco dictionary \n"; return 1; diff --git a/samples/cpp/tutorial_code/objectDetection/calibrate_camera.cpp b/samples/cpp/tutorial_code/objectDetection/calibrate_camera.cpp index b415477019..5662a84124 100644 --- a/samples/cpp/tutorial_code/objectDetection/calibrate_camera.cpp +++ b/samples/cpp/tutorial_code/objectDetection/calibrate_camera.cpp @@ -25,7 +25,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{@outfile |cam.yml| Output file with calibrated camera parameters }" "{v | | Input from video file, if ommited, input comes from camera }" diff --git a/samples/cpp/tutorial_code/objectDetection/calibrate_camera_charuco.cpp b/samples/cpp/tutorial_code/objectDetection/calibrate_camera_charuco.cpp index 5bea807db9..dcb2c8aa21 100644 --- a/samples/cpp/tutorial_code/objectDetection/calibrate_camera_charuco.cpp +++ b/samples/cpp/tutorial_code/objectDetection/calibrate_camera_charuco.cpp @@ -23,7 +23,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{@outfile |cam.yml| Output file with calibrated camera parameters }" "{v | | Input from video file, if ommited, input comes from camera }" diff --git a/samples/cpp/tutorial_code/objectDetection/create_board.cpp b/samples/cpp/tutorial_code/objectDetection/create_board.cpp index b1864ffc19..4af6f18da4 100644 --- a/samples/cpp/tutorial_code/objectDetection/create_board.cpp +++ b/samples/cpp/tutorial_code/objectDetection/create_board.cpp @@ -16,7 +16,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{m | | Margins size (in pixels). Default is marker separation (-s) }" "{bb | 1 | Number of bits in marker borders }" diff --git a/samples/cpp/tutorial_code/objectDetection/create_board_charuco.cpp b/samples/cpp/tutorial_code/objectDetection/create_board_charuco.cpp index b76708817a..e07bd670ec 100644 --- a/samples/cpp/tutorial_code/objectDetection/create_board_charuco.cpp +++ b/samples/cpp/tutorial_code/objectDetection/create_board_charuco.cpp @@ -17,7 +17,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{m | | Margins size (in pixels). Default is (squareLength-markerLength) }" "{bb | 1 | Number of bits in marker borders }" diff --git a/samples/cpp/tutorial_code/objectDetection/create_diamond.cpp b/samples/cpp/tutorial_code/objectDetection/create_diamond.cpp index 0db00e7e02..07effaca57 100644 --- a/samples/cpp/tutorial_code/objectDetection/create_diamond.cpp +++ b/samples/cpp/tutorial_code/objectDetection/create_diamond.cpp @@ -17,7 +17,8 @@ const char* keys = "{d | 10 | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{ids |0, 1, 2, 3 | Four ids for the ChArUco marker: id1,id2,id3,id4 }" "{m | 0 | Margins size (in pixels) }" "{bb | 1 | Number of bits in marker borders }" diff --git a/samples/cpp/tutorial_code/objectDetection/create_marker.cpp b/samples/cpp/tutorial_code/objectDetection/create_marker.cpp index 560e51c974..1ed78e4fe2 100644 --- a/samples/cpp/tutorial_code/objectDetection/create_marker.cpp +++ b/samples/cpp/tutorial_code/objectDetection/create_marker.cpp @@ -6,7 +6,7 @@ using namespace cv; namespace { -const char* about = "Create an ArUco marker image"; +const char* about = "Create an ArUco/AprilTag marker image"; //! [aruco_create_markers_keys] const char* keys = @@ -14,7 +14,8 @@ const char* keys = "{d | 0 | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{id | 0 | Marker id in the dictionary }" "{ms | 200 | Marker size in pixels }" diff --git a/samples/cpp/tutorial_code/objectDetection/detect_board.cpp b/samples/cpp/tutorial_code/objectDetection/detect_board.cpp index a9c74f2fdc..c7ed7ca7c0 100644 --- a/samples/cpp/tutorial_code/objectDetection/detect_board.cpp +++ b/samples/cpp/tutorial_code/objectDetection/detect_board.cpp @@ -19,7 +19,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{c | | Output file with calibrated camera parameters }" "{v | | Input from video or image file, if omitted, input comes from camera }" diff --git a/samples/cpp/tutorial_code/objectDetection/detect_board_charuco.cpp b/samples/cpp/tutorial_code/objectDetection/detect_board_charuco.cpp index c02318d6eb..7c4b5a6f50 100644 --- a/samples/cpp/tutorial_code/objectDetection/detect_board_charuco.cpp +++ b/samples/cpp/tutorial_code/objectDetection/detect_board_charuco.cpp @@ -19,7 +19,8 @@ const char* keys = "{d | | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{c | | Output file with calibrated camera parameters }" "{v | | Input from video or image file, if ommited, input comes from camera }" diff --git a/samples/cpp/tutorial_code/objectDetection/detect_diamonds.cpp b/samples/cpp/tutorial_code/objectDetection/detect_diamonds.cpp index f6a6236b2a..37097d87e9 100644 --- a/samples/cpp/tutorial_code/objectDetection/detect_diamonds.cpp +++ b/samples/cpp/tutorial_code/objectDetection/detect_diamonds.cpp @@ -16,7 +16,8 @@ const char* keys = "{d | 10 | dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2," "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," - "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}" + "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{c | | Output file with calibrated camera parameters }" "{as | | Automatic scale. The provided number is multiplied by the last" diff --git a/samples/cpp/tutorial_code/objectDetection/detect_markers.cpp b/samples/cpp/tutorial_code/objectDetection/detect_markers.cpp index f220b84565..06aa6221c4 100644 --- a/samples/cpp/tutorial_code/objectDetection/detect_markers.cpp +++ b/samples/cpp/tutorial_code/objectDetection/detect_markers.cpp @@ -15,7 +15,7 @@ const char* keys = "DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, " "DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12," "DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16," - "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20}" + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}" "{cd | | Input file with custom dictionary }" "{v | | Input from video or image file, if ommited, input comes from camera }" "{ci | 0 | Camera id if input doesnt come from video (-v) }" diff --git a/samples/python/aruco_detect_board_charuco.py b/samples/python/aruco_detect_board_charuco.py index ffb5ac677d..58ba5a899f 100644 --- a/samples/python/aruco_detect_board_charuco.py +++ b/samples/python/aruco_detect_board_charuco.py @@ -36,7 +36,8 @@ def main(): parser.add_argument("-d", help="dictionary: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2, DICT_4X4_1000=3," "DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, DICT_6X6_50=8," "DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12, DICT_7X7_100=13," - "DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16}", + "DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL=16," + "DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20, DICT_ARUCO_MIP_36h12=21}", default="0", action="store", dest="d", type=int) parser.add_argument("-ci", help="Camera id if input doesnt come from video (-v)", default="0", action="store", dest="ci", type=int) diff --git a/samples/python/calibrate.py b/samples/python/calibrate.py index 33c87b6a52..19c0ab0d66 100755 --- a/samples/python/calibrate.py +++ b/samples/python/calibrate.py @@ -100,7 +100,8 @@ def main(): 'DICT_APRILTAG_16h5': cv.aruco.DICT_APRILTAG_16h5, 'DICT_APRILTAG_25h9': cv.aruco.DICT_APRILTAG_25h9, 'DICT_APRILTAG_36h10': cv.aruco.DICT_APRILTAG_36h10, - 'DICT_APRILTAG_36h11': cv.aruco.DICT_APRILTAG_36h11 + 'DICT_APRILTAG_36h11': cv.aruco.DICT_APRILTAG_36h11, + 'DICT_ARUCO_MIP_36h12': cv.aruco.DICT_ARUCO_MIP_36h12 } if (aruco_dict_name not in set(aruco_dicts.keys())):