Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@AleksandrPanov
Copy link
Contributor

@AleksandrPanov AleksandrPanov commented Jan 16, 2024

Fixes #24806

The problem was only if the size of the image is not completely divided by the size of the square of the chessboard.

Now the corners of the chessboard are generated as closely as possible with the values of getChessboardCorners(), and now the error (between chessboard corners) is no more than 0.5 pixels.

Before fix:
image
After fix:
image

There are still some problems with ArUco markers.

Pull Request Readiness Checklist

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

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • 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.
  • The feature is well documented and sample code can be built with the project CMake

@AleksandrPanov AleksandrPanov changed the title fix generateImage for charuco chessboard Fix generateImage for charuco chessboard Jan 16, 2024
@asmorkalov asmorkalov added this to the 4.10.0 milestone Jan 17, 2024
@AleksandrPanov AleksandrPanov marked this pull request as ready for review January 17, 2024 08:17
Copy link
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@asmorkalov asmorkalov self-assigned this Jan 23, 2024
@asmorkalov asmorkalov merged commit 69772b0 into opencv:4.x Jan 23, 2024
@asmorkalov asmorkalov mentioned this pull request Jan 23, 2024
asmorkalov pushed a commit that referenced this pull request May 31, 2024
fixed marker generation in charuco board #25673

When generating  Charuco board markers in `generateImage()`, a problem occurs as in #24806, #24873:

In low resolution:
![charucoImg_before_fix2](https://github.com/opencv/opencv/assets/22337800/aab7b443-2d2a-4287-b869-708ac5976ea5)
In medium resolution:
![charucoImg_before_fix](https://github.com/opencv/opencv/assets/22337800/8c21ae42-d9c8-4cb5-9fcc-7814dfc07b80)

This PR fixed this problems:
![charucoImg_after_fix2](https://github.com/opencv/opencv/assets/22337800/93256dbb-8544-46eb-be78-844234e42ca9)
![charucoImg_after_fix](https://github.com/opencv/opencv/assets/22337800/f4d6794e-bee9-4ce4-8f9b-67a40800cbe5)

The test checks the inner and outer borders of the Aruco markers. In the outer border of Aruco marker, all pixels should be white. In the inner border of Aruco marker, all pixels should be black.
![image](https://github.com/opencv/opencv/assets/22337800/010a9c64-e03c-4239-9ac9-2cda9170793b)


### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ChArUco generation produces incorrect marker locations in the Chessboard

2 participants