EADST

Python: Two Rectangles Overlap Area (IoU)

Two Rectangles Overlap Area (IoU)

rec1 = [0, 0, 2, 2]
rec2 = [1, 1, 3, 3]
x = max(min(rec1[2], rec2[2]) - max(rec1[0], rec2[0]), 0)
y = max(min(rec1[3], rec2[3]) - max(rec1[1], rec2[1]), 0)
area = x * y

相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
站点统计

本站现有博文266篇,共被浏览440961

本站已经建立2019天!

热门文章
文章归档
回到顶部