Merge pull request #24597 from MaximSmolskiy:fix-bug-in-ChessBoardDetector-findQuadNeighbors

Fix bug in ChessBoardDetector::findQuadNeighbors #24597

### Pull Request Readiness Checklist

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
This commit is contained in:
Maxim Smolskiy 2023-11-30 10:59:06 +03:00 committed by GitHub
parent d97ed516a8
commit 10c43e5642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1630,7 +1630,7 @@ void ChessBoardDetector::findQuadNeighbors()
{ {
// check edge lengths, make sure they're compatible // check edge lengths, make sure they're compatible
// edges that are different by more than 1:4 are rejected // edges that are different by more than 1:4 are rejected
float ediff = cur_quad.edge_len - q_k.edge_len; const float ediff = fabs(cur_quad.edge_len - q_k.edge_len);
if (ediff > 32*cur_quad.edge_len || if (ediff > 32*cur_quad.edge_len ||
ediff > 32*q_k.edge_len) ediff > 32*q_k.edge_len)
{ {