问题描述
我正在尝试对图像进行注释,这是我所做注释中的 one
边界框详细信息,
Original Image - 注释基于此文档图像。
# annotation
{'x': 267.9,'y': 40.3,'height': 116.7,'width': 672.7,'center': [604.25,98.65],'points': [[267.9,40.3],[267.9,157],[940.6,40.3]]}
现在我还有另外五个小边界框,它们也是我注释的,
[{'x': 290,'y': 66,'width': 309,'height': 72,'center': [444.5,102.0],'points': [[290.0,66.0],[290.0,138.0],[599.0,66.0]]},{'x': 626,'y': 68,'width': 295,'center': [773.5,104.0],'points': [[626.0,68.0],[626.0,140.0],[921.0,68.0]]},{'x': 960,'y': 69,'width': 20,'height': 71,'center': [970.0,104.5],'points': [[960.0,69.0],[960.0,[980.0,69.0]]},{'x': 1000,'y': 72,'width': 881,'center': [1440.5,108.0],'points': [[1000.0,72.0],[1000.0,144.0],[1881.0,72.0]]},{'x': 1904,'y': 73,'width': 5,'center': [1906.5,108.5],'points': [[1904.0,73.0],[1904.0,[1909.0,73.0]]}
]
我正在寻找一种方法来找出上述 5 个边界框坐标中有多少重叠或进入我位于最顶部的第一个主边界框内。
我还需要一个选项来选择重叠的百分比以将其视为重叠。假设两个盒子稍微接触,我不想要它们。至少有 10-15% 的 bbox 应该是 Insider 来考虑它重叠或内部。
谁能帮助我了解如何实现这一目标?
期望输出:
在我的示例中,下面的这两个较小的边界框位于主边界框的内部或与其重叠。
[{'x': 290,68.0]]}]
我用来为 points
的边界框创建 center points,width,height
的函数是这样的,
def convert_points(center_x,center_y,height):
x = center_x
y = center_y
return [[x - width / 2,y - height / 2],[x - width / 2,y + height / 2],[x + width / 2,y - height / 2]]
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)