Merge pull request #21677 from chacha21:rectangle_intersection
authorPierre Chatelier <chacha21@users.noreply.github.com>
Wed, 16 Mar 2022 14:46:11 +0000 (15:46 +0100)
committerGitHub <noreply@github.com>
Wed, 16 Mar 2022 14:46:11 +0000 (17:46 +0300)
commitef6f421f8953c0a9d4e5d49074b0dc99975a3fa0
tree03dd83343d949f64f4c846dfeb7b18e1bf9cf9d5
parente0ffd3e8a5c25b634a853ce695c4d23d3057b361
Merge pull request #21677 from chacha21:rectangle_intersection

* better accuracy of _rotatedRectangleIntersection

instead of just migrating to double-precision (which would work), some computations are scaled by a factor that depends on the length of the smallest vectors.
There is a better accuracy even with floats, so this is certainly better for very sensitive cases

* Update intersection.cpp

use L2SQR norm to tune the numeric scale

* Update intersection.cpp

adapt samePointEps with L2 norm

* Update intersection.cpp

move comment

* Update intersection.cpp

fix wrong numericalScalingFactor usage

* added tests

* fixed warnings returned by buildbot

* modifications suggested by reviewer

renaming numericalScaleFctor to normalizationScale
refactor some computations
more "const"

* modifications as suggested by reviewer
modules/imgproc/src/intersection.cpp
modules/imgproc/test/test_intersection.cpp