Speed up adaptive threshold in findChessboardCorners#25177
Merged
asmorkalov merged 3 commits intoopencv:4.xfrom Mar 27, 2024
Merged
Conversation
asmorkalov
approved these changes
Mar 26, 2024
6ba9592 to
41e71d4
Compare
Contributor
Author
|
@AleksandrPanov Moving |
41e71d4 to
ba3fc90
Compare
Contributor
@MaximSmolskiy, thx, fixed |
Contributor
Merged
klatism
pushed a commit
to klatism/opencv
that referenced
this pull request
May 17, 2024
…image-binary-threshold-in-findChessboardCorners Speed up adaptive threshold in findChessboardCorners opencv#25177 ### Pull Request Readiness Checklist If `block_size` hasn't been changed between iterations for same `k`, then all `adaptiveThreshold` arguments will be same and we can reuse result from previous iteration. I tested this PR with benchmark ``` python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard ``` PR speed up chessboards detection by `7.5/17%` without any changes in detected chessboards number: ``` cell_img_size = 100 (default) before category detected chessboard total detected chessboard total chessboard average detected error chessboard all 0.904167 13020 14400 0.600512 Total detected time: 107.27875600000003 sec after category detected chessboard total detected chessboard total chessboard average detected error chessboard all 0.904167 13020 14400 0.600512 Total detected time: 99.0223499999999 sec ---------------------------------------------------------------------------------------------------------------------------------------------- cell_img_size = 10 before category detected chessboard total detected chessboard total chessboard average detected error chessboard all 0.539792 7773 14400 4.209964 Total detected time: 2.989205999999999 sec after category detected chessboard total detected chessboard total chessboard average detected error chessboard all 0.539792 7773 14400 4.209964 Total detected time: 2.4802350000000013 sec ``` 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 - [ ] 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
Tzila-m
pushed a commit
to Tzila-m/opencv
that referenced
this pull request
Jan 29, 2026
…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
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.


Pull Request Readiness Checklist
If
block_sizehasn't been changed between iterations for samek, then alladaptiveThresholdarguments will be same and we can reuse result from previous iteration.I tested this PR with benchmark
PR speed up chessboards detection by
7.5/17%without any changes in detected chessboards number: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.