Open Source Computer Vision Library
Go to file
Maxim Smolskiy 6ed603e917
Merge pull request #25991 from MaximSmolskiy:improve-corners-matching-in-ChessBoardDetector-NeighborsFinder-findCornerNeighbor
Improve corners matching in ChessBoardDetector::NeighborsFinder::findCornerNeighbor #25991

### Pull Request Readiness Checklist

Idea was mentioned in `Section III-B. New Heuristic for Quadrangle Linking` of `Rufli, 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):
![Снимок экрана от 2024-08-05 09-51-27](https://github.com/user-attachments/assets/7a090ccc-c24c-4dfb-b0dd-259c8709eb72)
```
* For each candidate pair, focus on the quadrangles they belong to and draw two straight lines passing through the midsections of the respective quadrangle edges (see Fig. 6).
* If the candidate corner and the source corner are on the same side of every of the four straight lines drawn this way (this corresponds to the yellow shaded area in Fig. 6), then the corners are successfully matched.
```

By improving corners matching, we can increase the search radius (`thresh_scale`).

I tested this PR with benchmark
```
python3 objdetect_benchmark.py --configuration=generate_run --board_x=7 --path=res_chessboard --synthetic_object=chessboard
```
PR increases detected chessboards number by `3/7%`:
```
cell_img_size = 100 (default)

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.910417                      13110             14400                           0.599746
Total detected time:  147.50906700000002 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.941667                      13560             14400                           0.596726
Total detected time:  136.68963200000007 sec

----------------------------------------------------------------------------------------------------------------------------------------------

cell_img_size = 10

before
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.539792                       7773             14400                           4.208237
Total detected time:  2.668964 sec

after
                                 category  detected chessboard  total detected chessboard  total chessboard  average detected error chessboard
                                      all             0.579167                       8340             14400                           4.198448
Total detected time:  2.535998999999999 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
- [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
2024-08-05 13:28:07 +03:00
.github Force contributors to define Apache 2.0 license for the new PRs. 2024-06-28 16:54:14 +03:00
3rdparty Update IPP integration 2024-07-18 08:16:19 -07:00
apps Merge pull request #25582 from fengyuentau:dnn/dump_pbtxt 2024-05-17 11:07:05 +03:00
cmake Merge pull request #25930 from opencv-pushbot:gitee/alalek/cmake_try_detect_feature_without_flags 2024-08-01 20:09:49 +00:00
data Merge pull request #22727 from su77ungr:patch-1 2022-11-17 06:54:25 +00:00
doc Merge pull request #25907 from Andy-SAKN:Andy-SAKN-add_orbbec 2024-07-18 17:27:00 +03:00
include exclude opencv_contrib modules 2020-02-26 15:12:45 +03:00
modules Merge pull request #25991 from MaximSmolskiy:improve-corners-matching-in-ChessBoardDetector-NeighborsFinder-findCornerNeighbor 2024-08-05 13:28:07 +03:00
platforms Fix toolchain. 2024-07-18 13:47:53 +00:00
samples Merge pull request #25822 from mqcmd196:gtk3-gl-support 2024-07-15 17:06:30 +03:00
.editorconfig add .editorconfig 2018-10-11 17:57:51 +00:00
.gitattributes cmake: generate and install ffmpeg-download.ps1 2018-06-09 13:19:48 +03:00
.gitignore Merge pull request #17165 from komakai:objc-binding 2020-06-08 18:32:53 +00:00
CMakeLists.txt cuda: prevent CMAKE_CUDA_ARCHITECTURES default from overiding OpenCV architecture search 2024-07-22 18:00:36 +03:00
CONTRIBUTING.md migration: github.com/opencv/opencv 2016-07-12 12:51:12 +03:00
COPYRIGHT copyright: 2023 (update) 2023-01-09 09:49:22 +00:00
LICENSE Merge pull request #18073 from vpisarev:apache2_license 2020-08-17 11:49:11 +00:00
README.md Space mistake in README.md 2024-03-03 23:37:07 +05:30
SECURITY.md Updated PGP key for security reports 2023-04-19 19:16:55 +03:00

OpenCV: Open Source Computer Vision Library

Resources

Contributing

Please read the contribution guidelines before starting work on a pull request.

Summary of the guidelines:

  • One pull request per issue;
  • Choose the right base branch;
  • Include tests and documentation;
  • Clean up "oops" commits before submitting;
  • Follow the coding style guide.

Additional Resources