Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2021-08-28 21:30:28 +00:00
10 changed files with 159 additions and 82 deletions

View File

@@ -46,7 +46,8 @@ float calcDistance(const Rect& a, const Rect& b)
{
Point2f p_a((float)(a.x + a.width / 2), (float)(a.y + a.height / 2));
Point2f p_b((float)(b.x + b.width / 2), (float)(b.y + b.height / 2));
return sqrt(pow(p_a.x - p_b.x, 2) + pow(p_a.y - p_b.y, 2));
Point2f diff = p_a - p_b;
return sqrt(diff.dot(diff));
}
float calcOverlap(const Rect& a, const Rect& b)