Compensate edge length in ChessBoardDetector::generateQuads#24833
Conversation
There was a problem hiding this comment.
I tested PR with benchmark:
--configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
before PR fix:

after PR fix + #24710 PR
There are no regressions, but I was unable to increase the number of chess boards found.
@MaximSmolskiy, is it possible for you to add a test?
What distortions did you fix the improvement on?
Is it a strong distortion of perspective or a strong blur or low resolution or all together?
What distortions should I add to the benchmark?
|
Thanks for merge! |
|
Looks like the patch affects test |
Reverted Compensate edge length in ChessBoardDetector::generateQuads #24833
…n-ChessBoardDetector-generateQuads-attempt-2 Compensate edge length in ChessBoardDetector::generateQuads (attempt 2) #25090 ### Pull Request Readiness Checklist New attempt for #24833, which was reverted as #25036. Locally I fixed `Calib3d_StereoCalibrate_CPP.regression` test by corners refinement using `cornerSubPix` function 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 - [ ] 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 I'm sorry for delay. This PR mainly affects chessboards with fairly small cell sizes, so I tried to run benchmark with decreased Commit 6f48cb78b60fbb8ccb4531b31a260b7ee60d00db Commit 853f7ff904b77f234aeac1a0edc48dc6756738a0 Differences in Differences in |
…ngth-in-ChessBoardDetector-generateQuads-attempt-2 Compensate edge length in ChessBoardDetector::generateQuads (attempt 2) opencv#25090 ### Pull Request Readiness Checklist New attempt for opencv#24833, which was reverted as opencv#25036. Locally I fixed `Calib3d_StereoCalibrate_CPP.regression` test by corners refinement using `cornerSubPix` function 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 - [ ] 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
Pull Request Readiness Checklist
Should be merged after #24710
Idea was mentioned in
Section III-C. Adaptive Quadrangle Linking DistanceofRufli, Martin & Scaramuzza, Davide & Siegwart, Roland. (2008). Automatic Detection of Checkerboards on Blurred and Distorted Images. 2008 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS. 3121-3126. 10.1109/IROS.2008.4650703(https://rpg.ifi.uzh.ch/docs/IROS08_scaramuzza_b.pdf):I increased edge length by
2 * dilationsbecause each dilation with3 x 3rectangular structuring element askernelin average case decrease edge length by one pixel but from each of two ends, so total edge length decrease is equal to2 * dilationsI tested this change (on 3.2.0 code version with some modern patches) on two private datasets and it increased number of found chessboards:
262to306~16.8%392to536~36.7%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.