Merge pull request #19842 from gasparitiago:3.4
authorTiago De Gaspari <gaspari.tiago@gmail.com>
Sat, 12 Jun 2021 20:28:54 +0000 (17:28 -0300)
committerGitHub <noreply@github.com>
Sat, 12 Jun 2021 20:28:54 +0000 (23:28 +0300)
commit3cf43753876e3c2c2676283d4fd10a6018b5a264
tree324c4c3a3d68ead2b46b0eab18f57fcebda59e43
parentc1adbe3189288518977749163b725b5c8ba86202
Merge pull request #19842 from gasparitiago:3.4

Update rotatedRectangleIntersection function to calculate near to origin

* Change type used in points function from RotatedRect

In the function that sets the points of a RotatedRect, the types

should be double in order to keep the precision when dealing with
RotatedRects that are defined far from the origin.

This commit solves the problem in some assertions from
rotatedRectangleIntersection when dealing with rectangles far from
origin.

* added proper type casts

* Update rotatedRectangleIntersection function to calculate near to origin

This commit changes the rotatedRectangleIntersection function in order
to calculate the intersection of two rectangles considering that they
are shifted near the coordinates origin (0, 0).

This commit solves the problem in some assertions from
rotatedRectangleIntersection when dealing with rectangles far from
origin.

* Revert type changes in types.cpp and adequate code to c++98

* Revert unnecessary casts on types.cpp

Co-authored-by: Vadim Pisarevsky <vadim.pisarevsky@gmail.com>
modules/imgproc/src/intersection.cpp
modules/imgproc/test/test_intersection.cpp