1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-25 21:33:04 +04:00

Merge pull request #25378 from AleksandrPanov:move_charuco_tutorial

Move Charuco/Calib tutorials and samples to main repo #25378

Merge with https://github.com/opencv/opencv_contrib/pull/3708

Move Charuco/Calib tutorials and samples to main repo:

- [x] update/fix charuco_detection.markdown and samples
- [x] update/fix charuco_diamond_detection.markdown and samples
- [x] update/fix aruco_calibration.markdown and samples
- [x] update/fix aruco_faq.markdown
- [x] move tutorials, samples and tests to main repo
- [x] remove old tutorials, samples and tests from contrib


### 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
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Alexander Panov
2024-04-16 12:14:33 +03:00
committed by GitHub
parent 4fb0541916
commit e2621f128e
33 changed files with 1947 additions and 137 deletions
@@ -23,7 +23,6 @@ const char* keys =
"{si | false | show generated image }";
}
int main(int argc, char *argv[]) {
CommandLineParser parser(argc, argv, keys);
parser.about(about);
@@ -57,25 +56,7 @@ int main(int argc, char *argv[]) {
imageSize.height =
markersY * (markerLength + markerSeparation) - markerSeparation + 2 * margins;
aruco::Dictionary dictionary = aruco::getPredefinedDictionary(cv::aruco::DICT_4X4_50);
if (parser.has("d")) {
int dictionaryId = parser.get<int>("d");
dictionary = aruco::getPredefinedDictionary(aruco::PredefinedDictionaryType(dictionaryId));
}
else if (parser.has("cd")) {
FileStorage fs(parser.get<std::string>("cd"), FileStorage::READ);
bool readOk = dictionary.readDictionary(fs.root());
if(!readOk)
{
std::cerr << "Invalid dictionary file" << std::endl;
return 0;
}
}
else {
std::cerr << "Dictionary not specified" << std::endl;
return 0;
}
aruco::Dictionary dictionary = readDictionatyFromCommandLine(parser);
aruco::GridBoard board(Size(markersX, markersY), float(markerLength), float(markerSeparation), dictionary);
// show created board
@@ -90,6 +71,5 @@ int main(int argc, char *argv[]) {
}
imwrite(out, boardImage);
return 0;
}