fix testBoardSubpixelCoords#3224
Merged
opencv-pushbot merged 1 commit intoopencv:4.xfrom Apr 13, 2022
Merged
Conversation
AleksandrPanov
commented
Apr 11, 2022
Comment on lines
-622
to
-624
| // load board image with corners at round values | ||
| cv::String testImagePath = cvtest::TS::ptr()->get_data_path() + "aruco/" + "trivial_board_detection.png"; | ||
| Mat img = imread(testImagePath); |
Contributor
Author
There was a problem hiding this comment.
Now the test image is generated.
AleksandrPanov
commented
Apr 11, 2022
Comment on lines
-626
to
+632
| 200, 300, | ||
| 250, 300, | ||
| 300, 300, | ||
| 200, 200, | ||
| 250, 200, | ||
| 300, 200, | ||
| 200, 250, | ||
| 250, 250, | ||
| 300, 250, | ||
| 200, 200, | ||
| 250, 200, | ||
| 300, 200 | ||
| 200, 300, | ||
| 250, 300, | ||
| 300, 300 |
Contributor
Author
There was a problem hiding this comment.
The positions of the "gold" markers have changed.
AleksandrPanov
commented
Apr 11, 2022
|
|
||
| // generate ChArUco board | ||
| board->draw(Size(res.width, res.height), gray, 150); | ||
| cv::GaussianBlur(gray, gray, Size(5, 5), 1.0); |
Contributor
Author
There was a problem hiding this comment.
Blur test image.
AleksandrPanov
commented
Apr 11, 2022
|
|
||
| cv::Mat c_ids, c_corners; | ||
| cv::aruco::interpolateCornersCharuco(corners, ids, gray, board, c_corners, c_ids, K); | ||
| cv::Mat corners_reshaped = c_corners.reshape(1); |
Contributor
Author
There was a problem hiding this comment.
variable corners_reshaped was not used
AleksandrPanov
commented
Apr 11, 2022
| c_ids = cv::Mat(); | ||
| c_corners = cv::Mat(); | ||
| cv::aruco::interpolateCornersCharuco(corners, ids, gray, board, c_corners, c_ids); | ||
| corners_reshaped = c_corners.reshape(1); |
Contributor
Author
There was a problem hiding this comment.
variable corners_reshaped was not used
AleksandrPanov
commented
Apr 11, 2022
|
|
||
| ASSERT_EQ(c_corners.rows, expected_corners.rows); | ||
| EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-3); | ||
| EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-1); |
Contributor
Author
There was a problem hiding this comment.
Reduced accuracy requirement to 0.1 of a pixel.
AleksandrPanov
commented
Apr 11, 2022
|
|
||
| ASSERT_EQ(c_corners.rows, expected_corners.rows); | ||
| EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-3); | ||
| EXPECT_NEAR(0, cvtest::norm(expected_corners, c_corners.reshape(1), NORM_INF), 1e-1); |
Contributor
Author
There was a problem hiding this comment.
Reduced accuracy requirement to 0.1 of a pixel.
asmorkalov
approved these changes
Apr 12, 2022
Contributor
|
LGTM: Tested on Ubuntu 18.04 amd64. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge with extra: opencv/opencv_extra#969

This PR fix and enable
testBoardSubpixelCoordstest.Old test image:
This ChArUco board configuration is currently not possible. The top left square should always be black.
New test image:

Blur added to the new test image to make the test more useful (the old image was also blurry, but not as much).
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.