目标识别(object detection)中的 IoU(Intersection over Union)

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

                       

首先直观上来看 IoU 的计算公式:



由上述图示可知,IoU 的计算综合考虑了交集和并集,如何使得 IoU 最大,需要满足,更大的重叠区域,更小的不重叠的区域。

两个矩形窗格分别表示:




这里写图片描述

左上点、右下点的坐标联合标识了一块矩形区域(bounding box),因此计算两块 Overlapping 的 bounding boxes 的 IoU 如下:

# ((x1[i], y1[i]), (x2[i], y2[i]))areai = (x2[i]-x1[i]+1)*(y2[i]-y1[i]+1)areaj = (x2[j]-x1[j]+1)*(y2[j]-y1[j]+1)xx1 = max(x1[i], x1[j])yy1 = max(y1[i], y1[j])xx2 = min(x2[i], x2[j])yy2 = min(y2[i], y2[j])h = max(0, yy2-yy1+1)w = max(0, xx2-xx1+1)intersection = w * hiou = intersection / (areai + areaj - intersection)
   
   
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow

这里写图片描述

猜你喜欢

转载自blog.csdn.net/hftytf/article/details/84195307
今日推荐