【问题标题】:Finding distance between two Histogram of Oriented Gradients Features查找两个方向梯度直方图特征之间的距离
【发布时间】:2020-12-16 01:21:46
【问题描述】:

我有两个 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 的距离应该比那个小。

【问题讨论】:

    标签: python image-processing image-preprocessing histogram-of-oriented-gradients


    【解决方案1】:

    试试这个。

    from scipy.spatial import distance
    a = (1, 2, 3)
    b = (4, 5, 6)
    dst = distance.euclidean(a, b)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-14
      • 2010-11-03
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多