Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6f213a

Browse filesBrowse files
Merge pull request opencv#27079 from MaximSmolskiy:add-test-for-ArucoDetector-detectMarkers
Add test for ArucoDetector::detectMarkers opencv#27079 ### Pull Request Readiness Checklist Related to opencv#26968 and opencv#26922 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. - [x] The feature is well documented and sample code can be built with the project CMake
1 parent 0a39f98 commit b6f213a
Copy full SHA for b6f213a

File tree

Expand file treeCollapse file tree

1 file changed

+34
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+34
-0
lines changed

‎modules/objdetect/test/test_arucodetection.cpp

Copy file name to clipboardExpand all lines: modules/objdetect/test/test_arucodetection.cpp
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,40 @@ TEST(CV_ArucoDetectMarkers, regression_contour_24220)
650650
}
651651
}
652652

653+
TEST(CV_ArucoDetectMarkers, regression_26922)
654+
{
655+
const auto arucoDict = aruco::getPredefinedDictionary(aruco::DICT_4X4_1000);
656+
const aruco::GridBoard gridBoard(Size(19, 10), 1, 0.25, arucoDict);
657+
658+
const Size imageSize(7200, 3825);
659+
660+
Mat boardImage;
661+
gridBoard.generateImage(imageSize, boardImage, 75, 1);
662+
663+
const aruco::ArucoDetector detector(arucoDict);
664+
665+
vector<vector<Point2f>> corners;
666+
vector<int> ids;
667+
detector.detectMarkers(boardImage, corners, ids);
668+
669+
EXPECT_EQ(ids.size(), 190ull);
670+
EXPECT_TRUE(find(ids.begin(), ids.end(), 76) != ids.end());
671+
EXPECT_TRUE(find(ids.begin(), ids.end(), 172) != ids.end());
672+
673+
float transformMatrixData[9] = {1, -0.2f, 300, 0.4f, 1, -1000, 0, 0, 1};
674+
const Mat transformMatrix(Size(3, 3), CV_32FC1, transformMatrixData);
675+
676+
Mat warpedImage;
677+
warpPerspective(boardImage, warpedImage, transformMatrix, imageSize);
678+
679+
detector.detectMarkers(warpedImage, corners, ids);
680+
681+
EXPECT_EQ(ids.size(), 133ull);
682+
// markers with id 76 and 172 are on border and should not be detected
683+
EXPECT_FALSE(find(ids.begin(), ids.end(), 76) != ids.end());
684+
EXPECT_FALSE(find(ids.begin(), ids.end(), 172) != ids.end());
685+
}
686+
653687
TEST(CV_ArucoMultiDict, setGetDictionaries)
654688
{
655689
vector<aruco::Dictionary> dictionaries = {aruco::getPredefinedDictionary(aruco::DICT_4X4_50), aruco::getPredefinedDictionary(aruco::DICT_5X5_100)};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.