opencv/modules/calib3d/src
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
..
opencl Misc. modules/ typos (cont.) 2018-02-12 10:15:36 -05:00
usac fix type for ilp64 api 2024-05-31 22:47:57 +08:00
ap3p.cpp Merge pull request #23607 from alexander-varjo:alexander-varjo-patch-1 2023-09-04 17:49:45 +03:00
ap3p.h Add SOLVEPNP_IPPE for planar pose estimation. Add solvePnPGeneric function that returns all the pose solutions and the reprojection errors. 2019-05-20 11:56:54 +02:00
calib3d_c_api.h Merge pull request #25141 from Kumataro:fix25140_4.x 2024-03-05 16:24:42 +03:00
calibinit.cpp Merge pull request #25991 from MaximSmolskiy:improve-corners-matching-in-ChessBoardDetector-NeighborsFinder-findCornerNeighbor 2024-08-05 13:28:07 +03:00
calibration_handeye.cpp Merge pull request #24897 from JStech:fix-handeye 2024-05-25 11:28:13 +03:00
calibration.cpp Merge pull request #25824 from j3knk:calib3d/fix_projectpoints 2024-07-15 15:10:08 +03:00
checkchessboard.cpp More fixes for iterators-are-pointers case 2023-09-15 12:37:43 +03:00
chessboard.cpp Use CV_LOG_DEBUG for debug logging in chessboard detector. 2024-07-15 16:11:27 +03:00
chessboard.hpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
circlesgrid.cpp fix detect rotated grid, added test 2024-03-25 14:07:03 +03:00
circlesgrid.hpp fix detect rotated grid, added test 2024-03-25 14:07:03 +03:00
compat_ptsetreg.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-12-03 12:32:49 +00:00
distortion_model.hpp calib3d: move undistort files from imgproc 2018-10-05 07:52:21 +00:00
dls.cpp Merge pull request #21405 from h6197627:3.4 2022-01-10 14:51:07 +03:00
dls.h Merge pull request #21405 from h6197627:3.4 2022-01-10 14:51:07 +03:00
epnp.cpp calib3d: initialize local vars, fix indentation in for loops 2019-05-27 14:39:47 +03:00
epnp.h Fixed some issues found by static analysis 2017-09-08 12:22:12 +03:00
fisheye.cpp Merge pull request #25028 from asmorkalov:as/fisheye_solvepnp 2024-02-16 17:54:40 +03:00
fisheye.hpp switch mask type from vector<int> to vector<uchar> 2015-11-21 00:45:45 +01:00
five-point.cpp Merge pull request #25064 from vpisarev:em_5point_fix 2024-02-22 12:04:13 +03:00
fundam.cpp Merge pull request #25665 from vrabaud:jacobian 2024-05-31 20:51:58 +03:00
hal_replacement.hpp Merge pull request #25511 from savuor:rv/hal_projectpoints 2024-05-20 10:42:17 +03:00
homography_decomp.cpp Merge pull request #13601 from JimZhou-001:JimZhou-001 2019-01-11 16:58:47 +03:00
ippe.cpp Fixed assertions on ippe solver 2020-09-21 21:56:28 -05:00
ippe.hpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
levmarq.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-16 04:40:39 +00:00
main.cpp IPPInitSingelton was added to contain IPP related global variables; 2015-10-01 09:58:48 +03:00
p3p.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
p3p.h Add SOLVEPNP_IPPE for planar pose estimation. Add solvePnPGeneric function that returns all the pose solutions and the reprojection errors. 2019-05-20 11:56:54 +02:00
polynom_solver.cpp Merge pull request #19583 from theroyalpekka:patch-1 2021-03-05 13:55:52 +00:00
polynom_solver.h
posit.cpp mostly removed obsolete C API from calib3d (at least at the interface level) (#13081) 2018-11-09 16:12:22 +03:00
precomp.hpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
ptsetreg.cpp Merge pull request #23078 from ivashmak:update_vsac 2023-06-16 10:59:13 +03:00
quadsubpix.cpp calib3d: fixed VS2019 warning C4756 2020-03-23 14:46:21 +03:00
rho.cpp Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
rho.h Merge pull request #23109 from seanm:misc-warnings 2023-10-06 13:33:21 +03:00
solvepnp.cpp Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
sqpnp.cpp Merge pull request #21702 from mlourakis:4.x 2022-05-13 18:11:14 +00:00
sqpnp.hpp cheirality -> chirality 2022-06-01 00:54:44 +01:00
stereobm.cpp Merge pull request #24301 from hanliutong:rewrite-stereo-sift 2023-09-25 13:03:25 +03:00
stereosgbm.cpp Merge pull request #24301 from hanliutong:rewrite-stereo-sift 2023-09-25 13:03:25 +03:00
triangulate.cpp Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
undistort.dispatch.cpp Merge pull request #21931 from victor1234:calib3d-add-undistortImagePoints 2022-05-12 08:56:58 +00:00
undistort.simd.hpp Merge pull request #24325 from hanliutong:rewrite 2023-10-05 17:57:25 +03:00
upnp.cpp build: GCC9 compilation 2019-11-12 18:49:34 +03:00
upnp.h build: GCC9 compilation 2019-11-12 18:49:34 +03:00
usac.hpp Merge pull request #24499 from ivashmak:usac_bug_fix 2023-11-20 15:47:35 +03:00