Skip to content

Fix regression in findChessboardCorners (issue #28028)#28471

Open
Tzila-m wants to merge 3 commits intoopencv:4.xfrom
Tzila-m:fix-chessboard-corners-28028
Open

Fix regression in findChessboardCorners (issue #28028)#28471
Tzila-m wants to merge 3 commits intoopencv:4.xfrom
Tzila-m:fix-chessboard-corners-28028

Conversation

@Tzila-m
Copy link
Copy Markdown

@Tzila-m Tzila-m commented Jan 28, 2026

Summary

This PR reverts PR #25177, which introduced a regression in findChessboardCorners.
Also a test with a new chessboard image is added.

Details

The regression appears after changes introduced in PR #25177 and is reproducible on the input image provided in issue #28028.

The current implementation skips some threshold/dilation combinations compared to the previous behavior, which can lead to missed detections in certain cases.

Fixes #28028
Related to #25177

@s-trinh
Copy link
Copy Markdown
Contributor

s-trinh commented Jan 28, 2026

Is it intended to be a revert of #25177 PR?
The LLM commit comment is not helpful:

Fix regression in findChessboardCorners (issue #28028)

  • Removed caching of prev_block_size to ensure consistent adaptive threshold processing
  • Added debug logging for troubleshooting

I think something like "revert commit" would be more appropriate if so.
Also, there are no debub logging in the code.


Comparing previous (https://github.com/opencv/opencv/pull/25177/changes) with current changes (5b5a8c6), I see some changes.

image


It turns out that these changes correspond to reverting ff9aeac and bcbc74d

@asmorkalov
Copy link
Copy Markdown
Contributor

@s-trinh Thanks a lot for analysis.

@Tzila-m
Copy link
Copy Markdown
Author

Tzila-m commented Jan 29, 2026

Test data added in opencv_extra PR #1315

Tzila added 3 commits January 29, 2026 13:45
…sboardCorners

This change fixes a regression introduced after PR opencv#25177, where certain adaptive
threshold and dilation combinations were unintentionally skipped during chessboard
detection.

The updated logic restores the missing block_size and dilation combinations that
were evaluated in OpenCV 4.8, without fully reverting the changes introduced later.

A regression test reproducing issue opencv#28028 is included.

Fixes opencv#28028
Related to opencv#25177
@Tzila-m Tzila-m force-pushed the fix-chessboard-corners-28028 branch from 902be5a to 28e09d2 Compare January 29, 2026 11:45
@Tzila-m
Copy link
Copy Markdown
Author

Tzila-m commented Jan 29, 2026

I realized that there is a repository for images for tests, I opened a PR in opencv_extra with the image opencv/opencv_extra#1315 .
Then I hope the CI will work.
@asmorkalov @s-trinh

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.

findChessboardCorners returns false after upgrading from 4.8 to 4.12

3 participants