【发布时间】:2018-03-17 14:46:53
【问题描述】:
我有以下问题。我尝试计算联合上的交集,即两个分量的重叠除以两个分量的联合。让我们假设 component1 是一个矩阵,其中包含第一个对象,而 component2 是一个矩阵,其中包含第二个对象。我可以用np.logical_and(component == 1, component2 == 1) 计算重叠。但是我怎样才能计算联盟呢?我只对连接的对象感兴趣。
import numpy as np
component1 = np.array([[0,1,1],[0,1,1],[0,1,1]])
component2 = np.array([[1,1,0],[1,1,0],[1,1,0]])
overlap = np.logical_and(component == 1, component2 == 1)
union = ?
IOU = len(overlap)/len(union)
【问题讨论】:
-
您希望从帖子中的输入中获得什么?
-
你的意思是我想要的输出吗?这将是:IOU = 重叠/联合
-
抱歉,是的,想要的输出..在这一切结束时不清楚你想要什么。
-
我想要 scoure 或 Number,它是通过联合点的数量潜水的重叠点的数量。有了这个分数,我进行后处理计算