1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

imgproc: add rotatedRectangleIntersection empty input handling

This commit is contained in:
Alexander Alekhin
2020-12-20 02:05:46 +00:00
parent ef27c11d50
commit 17faee5d81
2 changed files with 31 additions and 0 deletions
+6
View File
@@ -54,6 +54,12 @@ int rotatedRectangleIntersection( const RotatedRect& rect1, const RotatedRect& r
// L2 metric
const float samePointEps = std::max(1e-16f, 1e-6f * (float)std::max(rect1.size.area(), rect2.size.area()));
if (rect1.size.empty() || rect2.size.empty())
{
intersectingRegion.release();
return INTERSECT_NONE;
}
Point2f vec1[4], vec2[4];
Point2f pts1[4], pts2[4];