opencv/modules
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
..
calib3d Merge pull request #25991 from MaximSmolskiy:improve-corners-matching-in-ChessBoardDetector-NeighborsFinder-findCornerNeighbor 2024-08-05 13:28:07 +03:00
core Merge pull request #25979 from asmorkalov:as/custom_allocator 2024-08-05 11:52:00 +03:00
dnn fix compilation errors caused by namespace 2024-08-04 05:04:03 +08:00
features2d Added Java ORB test 2024-07-25 16:47:41 +03:00
flann Prevent signed integer overflow in LshTable 2024-05-24 23:47:36 +02:00
gapi Merge pull request #25817 from lamiayous:ly/extend_onnxrt_gapi_backend_handle_i32_i64_type 2024-07-12 11:38:43 +03:00
highgui highgui: Make GThread mandatory with GTK 2024-07-15 16:30:39 +02:00
imgcodecs Improved error handling in image codecs. 2024-08-01 08:34:29 +03:00
imgproc Merge pull request #25898 from Octopus136:issue-25853 2024-07-19 09:08:19 +03:00
java Merge pull request #25856 from alexlyulkov:al/android-optional-kotlin 2024-07-04 13:26:37 +03:00
js fix: js perf tests 2024-07-26 13:24:26 -07:00
ml Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
objc fix: resolve Swift method name conflicts by adding missing namespace 2024-07-18 00:20:17 +08:00
objdetect Merge pull request #25938 from vrabaud:charuco 2024-07-24 09:27:07 +03:00
photo photo: doc: Fix window range for fastNlMeansDenoisingMulti 2024-06-21 21:04:22 +08:00
python python: prefer cv::Mat over cv::UMat in python binding 2024-07-21 10:00:29 +09:00
stitching Partially back-port #25075 to 4.x 2024-03-05 12:15:39 +03:00
ts Report used HAL to test log and xml 2024-07-23 12:03:39 +03:00
video Merge pull request #25771 from fengyuentau:vittrack_black_input 2024-06-18 12:48:28 +03:00
videoio Fix path to 3rdparty cmake. 2024-08-02 10:07:36 +02:00
world cmake: use /INCREMENTAL:NO with MSVS 2015 2023-12-07 19:46:27 +00:00