确定两个方向梯度特征直方图之间的距离

2024-09-30 20:36:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我有两个4000维的HOG特征,由cv2.HOGDescriptor创建。我需要找到这两个向量之间的距离

def getDistances(firstFace,secondFace):
EuclideanDistance = distance.euclidean(firstFace,secondFace)
print("Euclidean distance from x to y: ", EuclideanDistance)

我试过这样的方法,但结果似乎不对。如果我需要解释,我有3张图片。A和B几乎相同。C完全不同

Euclidean distance from x to y:  232.5758819580078 # A and C
Euclidean distance from x to y:  238.22845458984375 # B and C
Euclidean distance from x to y:  249.4779052734375 # A and B

A和B的距离应小于该距离


Tags: andtofrom距离def特征cv2向量